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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database empty? How to recover? FPT is there

Status
Not open for further replies.

fje

Technical User
Jun 8, 2007
3
Hi,

I have a very old application (that I didn't developped and that it is not supported any more :( ) that uses a database that seems to be FoxPro DB.

I don't know why but I did a "database compress" using the application tool and when afterwards I opened the application it gave to me an error (sorry, I didn't write down it...) and the database seems to be totally empty.... it used to have hundred of records, but it seems to be empty now....

I had a look to the .FPT file using several programs, notebook, execel, etc. etc., and it seems to be data there, but I don't know how to recover the data into the .DBF file to be able to work with it again.

Needless to say that I'm not knowledgeable of database, but anyway I tried several of the DB recovery tools, none of them gave me the older .DBF contents.

Any idea of help ?

Thanks so much.
 
Finally !!!! (Almost) Solved

I was able to recover as "lost file" the .DBF file. The problem then was that several of the rows at the end of the file had invalid data and the application crashed when accessing to those data.

I was trying to solve the problem with DBF recovery tools, but no way. Finally I opened the file as ".dbf file" with Excel, I was able to delete the "offending" rows and save again it as ".dbf file".

It worked !!!! I have the database as of 3 weeks ago.... not bad, taking into account that my first situation was "no data" and the second one was a backup of october 2006, with a lot (and a lot is thousands) of new registers since then.

Now, I'll do a weekly backup !!!!!!!!!!!!!!!!!!!

Thanks to all of you that helped.

Javier
 
Be cautious of opening DBF files with Excel.

Too often Excel has a nasty habit of changing the data in one way or another.

I have encountered the following problems at one time or another:
1. Character fields changed to Numeric
2. When a Character field is changed to Numeric, if the first character is a 0 (zero) it is dropped off.
3. Character fields have changed length (generally getting shorter) resulting in truncated data.
4. By not highlighting EXACTLY the specific rows & columns desired and then doing a Save As... into DBF format, I have un-intentionally had rows of garbage added, or added un-wanted columns.

Be cautious. Excel can be used to LOOK at the data, but using it to change the data and/or to use it as a file format converter can sometimes result in un-anticipated and un-wanted results.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Fje,

the fpt file just contains memo field contents, so you wouldn't be able to recover data from that file only. It seems the dbf file you could resore had some records pointing to memo contents, which were not in the fpt file you had. If you find the corresponding fpt file, you should be able to keep the "offending" records.

You're much better off making daily backups, not only weekly.

i don't know how the compression feature of the app is programmed. Issuing a PACK to the table would be a way to stripe off deleted records, which saves space. But if you don't check you have enough disk space (in the worst case you need as much free disk space, as the dbf/idx/fpt files are using up) and not getting exclusive access you can fail to pack. I don't know and haven't tested for example, what's happening, if you have idx files open, while PACKing.

All in all it seems you should not make use of the apps compression feature.

Bye, Olaf.
 
Fje,
Can not remember when the PACK MEMO command was added. I think it was version 2.0
The PACK MEMO Resyncs the FPT with the DBF.
I allway do this when I pack (Compress) as table with a Memo Field

use xxxx.DBF Exclusive
PACK
IF FILE("xxxx.FPT")
PACK MEMO
ENDIF


David W. Grewe Dave
 
Thank to everyone.... suppose I try to do the PACK out of the application (what is what I would like to do from now on). For doing it I will need some "runtime" exec pf the Foxpro. Where could I find and download it?

Rgds.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top