Question : How to repair a corrupt FPT file

I have a corrupt FPT file that I cannot repair. The DBF that is associated with it has 52 records of information. Ive pin-pointed where the corrupted fields are. I have a memo field with the name mplacement. There are exactly 4 so called corrupted records in the mplacement field.  The corruption starts at record 18. Records 18  21 seem to be the corrupted ones. Records 1  17 seem to display information correctly. When I export the information from this DBF into an XLS, it only goes to record 17 and then quits, leaving the rest of the records out. When I open the FPT with a Hex Editor, the data displayed ends with record 17, like there is no more data.

Heres the tricky part. When I open the application and go into 4 records (other than the 4 corrupted ones) and enter data into that mplacement memo field, it magically fixes the FPT and I dont get the Error 41, Memo file is missing or invalid anymore.  When I open the FPT back up in a Hex Editor, it shows me records 1  17 and my newly added data for the 4 entries at the bottom. I still cant seem to recover all of the data from the memo field from records 18  52. Ive got backups (at the time of corruption) of the DBF and FPT so I can try anything. Any help is much appreciated.

Answer : How to repair a corrupt FPT file

Not only that, it writes a single memo content to a single file. It's meeant that way, as this kind of dump does not have any structure to write many memo values and distinguish between them. The simplest file format that would do that would be the fpt format or rather similar, because it consists of the concatenated memo values and a length. Within the dbf all that's stored is an offset from the file begin.

So as you want a more stable file format, that's what I'd recommend. To get all memo fields, you'd add a call for each memo field. To cover all records it's sufficient to do this in insert and update triggers, as each such tale operation then will create the file for that specific memo.

So if you have repeated and reproducable problems with fpt files, you may investigate your network hardware and performance. If this is a one time case that let's you think about fpt files this way, I can't help you other than by saying that in my 9 years experience with VFP since VFP6 I had no corrupt fpt file, I had corrupt cdx and dbfs, but no fpt. And even if some records are corrupt, you can read out the intact values from the fpt, it's not much more than the concatenation of values, what's stored in such a file.

Bye, Olaf.
Random Solutions  
 
programming4us programming4us