Foxpro data anomaly
Foxpro data anomaly
Yesterday I did that but when I used my app on the laptop at "work" to browse the data it was screwy. The function I was using browses a single table. AFAIK, only that table was affected, but that may certainly not be the case. Browsing that one table, a considerable portion of the data I was seeing (guessing over 20% maybe 30% or more) appeared to have blank records. None of the fields were populated. Other records looked "fine."
I brought the portable hard drive home along with the laptop, hoping that the data I'd copied to them wasn't likewise screwy. To my relief, it looks fine.
Today, I opened the questionable table I was looking at using my home laptop (and not using my app, just the VFP 9 command window), the one on the portable hard drive, and it looks just as screwy... there appear to be a whole lot of blank records.
I tried this: In a command window of VFP 9.0, I set the record pointer on a seemingly empty record and did this:
Artist is a character field of 80 characters length. It should never be empty and is almost never the full 80 characters.
VFP returned 80. If the field were empty it should say 0.
I then entered this:
?Subs(artist,1,1) = " "
It returned .F. I'd expect that for any populated record (artist is always left justified) but not for a record whose artist field appears blank in a browse.
Now almost all entries in the Artist field are less than 80 characters, IOW, LEN(ALLTRIM(ARTIST)) should return an integer less than 80, more typically maybe 25.
The number of records in the strangely acting DBF file is the same as the number on my NAS's version, which AFAIK is fine (26682). The table has a complex index and 30 fields. I don't know how to interpret what's going on here. I'd like to know, of course.
It seems that the data that wound up on the portable HD after I ran my batch file yesterday is corrupt. How and why I have no idea. I'd have no idea how to retrieve it if I didn't have a "working" copy on my NAS. Of course, at work yesterday I was barely able to use the data.