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

Corrupt tables (very urgent) 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello together,

last night we had problems with power-supply and our VFP(6.0)-Fileserver crashed. Now we got the problem, that there are some corrupt tables with at least 50.000 lines less than necessary but the file-size of these tables could be correct, so i guess, that the missing data is still there but not visible anymore. If i try to export with "copy to" vfp crashes.
The last data we are able to browse is some days old. Do you have an idea, how we could repair these tables and make the missing data visible ? Reindex didn't help.

Thanx and greetings from germany

Buck



 
Did you try dropping the indexes and then recreating them? (not that I'm any expert on such things, but that's what everyone around here says to do, so I might as well say it first.) BTW, this sounds similar to having to rebuild B-trees which is what my wife was always having to do when she was database administrator for a UNIX database.

Dave Dardinger
 
Thank you for that fast response ! Rebuilding the indexes was one of the first things i did, but it didn't help. Because of the file-size (of the dbf-file) i am sure, that the data is still sowewhere in. Are there any recovery-tools out there that could help me out ? i heard about FoxFix and i wouldn't mind to buy it, but i need to get it working till monday morning (now it's saturday afternoon in germany), so i need a tool (maybe shareware) which i can download somewhere imediatly.

Thanx for your help.

Buck
 
Does the record count at the bottom look like the right number? If yes, dropping the indexes might do it. If dropping indexes doesn't help, you might try the following:

*********************

Copy the file to a new file using win-explorer so you don't blow away what you still have.

Using a text editor open the .dbf and strip the header out. It is not too difficult to pick up on the header info and strip just it out.

Once the header is stripped, save the file as a .txt file.

Create a structure file with no records. Since you have an accurate .dbf a few days old, you can copy stru to and get your empty .dbf that way. Otherwise, you'll have to create a new empty structure file.

Use the new empty file.

Append from the .txt file as a space delimited file.

This will result in a new file with all the records that were in the old file.

*********

I have also had files that would let me use the file with no index. If I issued GOTO BOTT, it would get the last records and browse up to a certain record that had a trashed byte. If I started at the top of the file, I could browse or skip down to the same record. In this case:

************
use file
goto top
copy to newfile while recno() < badrecno

goto bott
copy stru to bottomfile

do while recno() > badrecno
select bottomfile
append blank
select txtfile
replace bottomfile.&quot;allfields&quot; with &quot;allfields&quot; &&multiple replaces here for all fields
skip -1
enddo

************

Contact me @ mikea@acan.net this weekend or mandreas@isdh.state.in.us during the week if you need further help.


 
Oops, I forgot to mention that you would then combine newfile and bottomfile to have one file that was missing just the trashed record.
 
Sounds like a really good idea. I will test it now and let you know really soon if it helped me.

By the way: This seems to be a really good forum. Think i should register!
Again, thanks for that really fast response !!

Greetings

Buck
 
Further thought leads me to believe that you have a trashed record and the second method might be your answer. Try going to the bottom and see how far up you can browse. A lot of times, a date field can give you clues as to how much data is above or below the trashed record.

This forum has saved my bacon more than once, and has definately helped me produce better code.
 
I guess i am in real trouble now. When i browse the dbf-file with the foxpro-editor, there is huge block of thrash at the end, right after the last record which i am still able to browse. i guess, that this is the data i am trying to recover. There is nothing i am able to read when this block starts. Seems that my data is definitly lost, right ?!? :-((

Buck
 
If you want me to look at it, zip it up and email to me. You can copy to temp file and use temp. Delete the first good records, leaving one or two good ones. Then do the zip.

mikea@acan.net
 
Sure. The last record i am able to browse is also the last record wich i am able to read when i use the foxpro-texteditor. After his record the trash-block appears.

Buck
 
Double check the file size vs current records and expected records. If it seems that the size is correct for still retaining the &quot;missing records&quot;, send me a copy as I showed above. Also, compare the file size of a copy of the file with the original. If different, the trashed record may have an eof marker that is not letting you make a copy of the entire file. In that case, try working on the original. At this point you have nothing more to lose.
 
Sorry for letting you wait, but now the internet-router didn't work proper (i hate this weekend) ! I would like to send you a copy but there is one problem: the original table is bigger than 100megs. when i delete some records an pack the table, the trahs-block at the end of the file disappears. the only thing i can do, is to cut out the part with the editor. would that help ?

Buck
 
I'm thinking that the records are past the trash part. Do you have Norton Utilities?
 
Zip won't even grab it all if there is an EOF marker in the middle.
 
Sorry, no Norton available. So you think, that even in the text-editor the part behind the trash is just not displayed because of an eof-mark ? that seems to be my last chance.

Have you got the possibility to enter a chatroom (for easier conversation) ?

Buck

 
I tried to browse the file with UltraEdit-Hexeditor. The trash-block at the end of the file contains just 00-Data.
:-((

 
I just changed my security to allow you to find me by my email address - mikea@acan.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top