Link to home
Start Free TrialLog in
Avatar of tamilsoft
tamilsoft

asked on

"not a database file" error in foxpro2.6 for dos

I am using foxpro2.6 for dos.

I found the error "not a database file"   when i use the  following command.

 use llist.dbf

 what is the reason?
  how to rectify it?


Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

The dbf file is defect, perhaps jsut a defect of header information contradicting file information, eg a reccount stored there does not fit the file size expected.

You can use tools like foxfix to (try to) fix that or restore a backup of that table.

In VFP8 or higher you are able to SET TABLEVALIDATE 0 (turning off any validation of a dbf file header) and then correct the dbf perhaps via APPEND BLANK/DELETE NEXT 1/PACK. With Foxpro DOS you can't do that.

Bye, Olaf.
Avatar of tamilsoft
tamilsoft

ASKER

file size has 32 bytes.
file size displays correctly.
how to rectify it?
if i can send that file dbf file, can you rectify it ?

 
32 bytes is even too less to be just a dbf file header, that menas the file is even too small to be an empty dbf. I fear there is nothing you can save there, sorry. Are you sure you talk of 32 bytes and not 32 KBytes?

Bye, Olaf.

that dbf file has  4608 bytes.
I typed that file through dos.
few of records found without order

please tell how to rectify it?
please tell how to rectify it?

Olaf already told you how to rectify.

From above - You can use tools like foxfix to (try to) fix that or restore a backup of that table.

I typed that file through dos.

Foxpro is looking for specifics within the file header to identify the file as a Valid dbf file.  If it does not find what it is looking for, it will generate the  not a database file  error message.

Typing the dbf file contents in some manner will only verify that there is data in the file.  
But that method will not verify if it is a Valid dbf file for use with Foxpro.  

Make a backup copy of the dbf file (and any associated IDX, CDX, FPT files).
Do a Google search for   FoxFix  and get a copy of the program
Run   FoxFix on the dbf file
Try to run the Foxpro application.

Good Luck



"not a database file" is also reported when the DBF file was created in Visual FoxPro.

You may add .TXT extension to it and post it here for further investigations.
please take and consider the following attached my dbf file that has error above I told "not a database file"
please rectify following attached  llist.dbf for foxpro2.6(dos)
     
no attachment found
after downloaded following file  change the file extension from txt to dbf

LLIST.txt
The problem is in file size which is much lower than the number of records stored in the file header (32). The dbf is possible to open when you update the number of records in file header to 22 and adjust the file size by about 20 bytes. Also several DBF viewers can display all available data.

Such corruption may occur when computer crashes during records appending.


LLIST.dbf.txt
even if you have solid backups, it would be worth acquiring foxfix.  it will save you countless hours.

http://hallogram.com/foxfix/
ASKER CERTIFIED SOLUTION
Avatar of jrbbldr
jrbbldr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just to round up: Here is why this header is defect:

If you meant 32 records instead of 32 bytes earlier, and you found that in the dbf header in the bytes storing the reccount, as pcelba did later, then the expected file size of that dbf is HEADER()+32*RECSIZE(), in general HEADER()+RECCOUNT()*RECSIZE()+1

I checked with a browser.dbf: File size reported by OS: 12.897 Bytes, calculated: 12.897. Works. The additional byte is the EOF mark, the last byte of the dbf, it's chr(26).

It's fine the OS reports a file size as it really is, but the header says something different. If, as pavel found out, the file size is only sufficient for 22 records, you lost 10 records and there is no way repairing them, getting them back, you can only save the 22 records.

...do backups...

Bye, Olaf.