Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NOT A DATABASE FILE

Status
Not open for further replies.

BBCH

Programmer
Feb 17, 2001
1
MX
SORRY FOR MY ENGLISH !! WHEN I HAVE ANY ELECTRICAL FAILURE IN MY COMPUTER ( FOR EXAMPLE, SHUT DOWN ) AND I HAVE SOME DATABASE OPEN, ALMOST EVER WHEN I RESTART MY SYSTEM, AND SELECT THE FILE, I HAVE THIS PROBLEM ... H E L P !!!!!
 
I'm sorry, but this is an unfortunate consequence of the .DBF file structure and the nature of operating system buffering. Since .DBF's carry both the data and a header record count, they can get out of sync when all buffered data can't be written out (this is the major reason that you get this error message).

Consider:
a) Getting a UPS to compensate for power failures.
b) Add procedures to not turn off the PC where the database resides, without first shutting down the application.
c) Close the file after each write/update in the application.
d) Get a utility to fix the database headers - there are many free ones available in addition to the commercial ones. Note: These won't reliably recover ALL the data lost, but they will get you back to the point where you can normally manually fix what may be missing.

Bottom line is to avoid the problem by addressing the hardware and procedural problems.

Rick
 
I used to get power failure header damage on a regular basis, and wrote my own recovery routines, using low level file commands. It's been a while, so I'm not prepared to write the step-by-step for you, but it can be done.

My method was a bit different than trying to correct the file length value in the header. You have to find your way past the header to the beginning of your first record and know the structure of the file. If you're interested in that approach I'll track down and send you some code that you could start with. And as Rick suggested, by all means, get a power supply. Good luck!
 
TRY WITH THE FOXFIX.PLB LIBRARY, I USE IT AND WORKS SO VERY GOOD.
 
I have a little program (fixfoxpo.exe) and this one repair the header of the .DBF file.

If you need it send me a mail : lopezhernan@marin.esc.edu.ar

If you speak in spanish send me a spanish mail.
 
TRY FOXFIX.PLB WITH FIXALL.PRG, DOWNLOAD IT USING LYCOS FOR SEARCH WITH THE KEYWORD FOXFIX.
 
Hi,
i have a home made small program that repairs fox 2.6 database file .dbf
if you need just e-mail me
lhornn@aquitaine-valley.fr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top