I doubt hinting on repair tools will help.
Broken DBFs have the error message "Not a table" (Error 15) or you can have "Database is invalid. Please validate." (error 1561) when opening a broken DBC.
If the cdx is corrupt "Index file does not match table" (Error 19)
There are a few more reported because you can't open the table due to permission issues or locks, but not because its corrupt.
Then there are structural errors not seen while opening but when using the table, eg if the table has memo field there is a FPT file and the DBF has offset pointers going into that FPT. It would be doable to check all offsets are within the FPT file size, but as with the index nodex pointing to possibly not existing recnos, this can be broken and will only sho so, if you access such a memo field. It would be unbearable any opening would check every such pointer or reference of validity.
The error you mention, Montant42, is error number 5 and is explained by:
VFP help on error 5 said:
The record number you attempted to access is beyond the actual number of records contained in the current table.
Access to any record other than recno 1 doesn't happen from just opening a table. So opening a table alone doesn't move to any record not existing. If there is no record number 1 the same position will be the end of fily mark byte and thus the normal opening position of a DBF right after the DBF header always exists and doesn't cause ERROR 5. You'd have to open with an index/sort order to let the index position on the first record in index order. Then such an error might happen with the index out of sync with the DBF data, containg index nodes pointing to a non existing record.
But if you even can't tell how the table is opened, eg with specifying an index sort order, I can only guess and make assumptions and that's in general not a final truth and not helpful.
If you're just a user of an application written in foxpro or similar langueage using dbfs to store data, you should contact the vendor of that application.
You expect there'll be a simple way to fix all corruptions, ther isn't.
tightog said:
helps to get .dbf files back after any level of corruption
I would be cautious making such assertions. If a file has a corrupt block not having the original, you can't get it back any way, all such a software could do is put back a healthy dbf structure at such missing blocks, but it can't know the content of the "fixed" rows. Many defects can only be replaced by blanked fields, so the DBF can be used again, but has data lost.
Even if you get a DBF working again and it turns out there was something in there or in a related file like FPT or CDX or IDX or DBC, you should also compare with a restored backup, especially what changed in the records fixed. And most such end user tools will not tell you which recnos they fixed, so it's hardly comparable to what you might be able to restore from your backup.
A table is not a car or something like that, an object with a defined structure and its motor compartment, tires, brakes. You can re4place that, but no car mechanic will fix your broken or lost trunk contents. Not because it's not his job, but because if there is something missing he can't know what was there. If there is a broken milk bottle he can conclude this was a whole bottle, but it might already have been half emptied before it broke.
In a DBF, if you find part of text, you might guess and reconstruct something, as with any text in any file type. The problem with broken dbfs is they mainly are the trunk and not a structure with parts that need to be at defined places like the motor compartment. You only have the header and the rest then is data. As already said you also have pionters from DBF to FPT files and from CDX to the DBF file. Then you have the deletion mark bytes, which should only either be space or "*", but all other bytes are not limited to a restricted set of valid values. An int for example has 4 bytes and any byte value is possible in all 4 of them. You can't detect a broken int field and repair it with any tool, for that reason, and that's just one example.
Bye, Olaf.