"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?


tamilsoftAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Olaf DoschkeSoftware DeveloperCommented:
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.
0
tamilsoftAuthor Commented:
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 ?

 
0
Olaf DoschkeSoftware DeveloperCommented:
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.

0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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

please tell how to rectify it?
0
jrbbldrCommented:
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



0
pcelbaCommented:
"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.
0
tamilsoftAuthor Commented:
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)
     
0
Olaf DoschkeSoftware DeveloperCommented:
no attachment found
0
tamilsoftAuthor Commented:
after downloaded following file  change the file extension from txt to dbf

LLIST.txt
0
pcelbaCommented:
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
0
jsrebnikCommented:
even if you have solid backups, it would be worth acquiring foxfix.  it will save you countless hours.

http://hallogram.com/foxfix/
0
jrbbldrCommented:
please rectify following attached  llist.dbf for foxpro2.6(dos)

Keep in mind that this is a forum where we HELP YOU do the work, we don't do the work FOR YOU.

A number of us have offered suggestions and advice above on how to rectify your problem, now it is your turn to show us that you appreciate our support (and perhaps continued support) by doing the work yourself.

If you want someone to do the work FOR YOU, you can HIRE a consultant/contractor to do the work.

Good Luck

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Olaf DoschkeSoftware DeveloperCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.