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!

End of file encountered 3

Status
Not open for further replies.

pdsterling

Technical User
Mar 3, 2005
25
US
I have suffered a hard drive crash which was so annoying; I had carefully backed up all data, and two days later, before the next backup, my hard drive died, and it died in mid-edit, using dBASE V.

It seems I read somewhere than an occult code (possibly CTL+Z) can get in where it does not belong, and it seems I read somewhere how to scrub the file from occult codes, but I can in no way figure where to start.

Any advice would be gratefully appreciated.
thumbsup2.gif



pdsterling
 
First, be sure you work with copies of your tables.

Is the table indexed? If so, all you may need to do is reindex the table (issue the REINDEX command in exclusive mode). Be forewarned that if it is corrupted then you may have to delete the index file and recreate it. (Or get the last know okay index file from a backup and REINDEX that.)

Otherwise your program may not have updated the header, so the record count does not match the expected file size. There are programs which scan and repair tables.

I wrote a program long ago in faq290-4606 to examine a table and it should tell you some details about the possible issues it finds.

thread290-857475 might be helpful and I give code there to create a new table, probably leaving damaged records behind..

thread182-799130 talks about solutions in a similar xBase language, FoxPro.

dbMark
 
Mark: I have been doing dBASE for a long time; I may have neglected to say I am dBASE V for DOS, and haven't updated anything for Windows or the new company which took over.

Your advice very helpful, and I am ashamed to say I reinvented the wheel before you posted, and am trying again. I did delete each and every index and re-created them, and I am furious that I didn't have the hard drive backed up. The data was, by and large, all right, having been backed up two days before, but apparently at the time of the crash, something affected the open database.

Anyway, many grateful thanks for your posting.
medal.gif
medal.gif
medal.gif


Hopefully we will talk again under less stressful conditions (this is like a funeral)

P D Sterling
Dallas TX
 
Okay, I am not getting far with the provided help. The procedure under FAQ290-4606 only went 55 lines and hung up, and I am at a loss on how to edit it. Thread290-857475 didn't work for me, either. I do know enough to replace MyFile with a copy of *my* file.

Making a new file by copying didn't work - it copied 143K records of 1643k records, and then everything else was "out of range" or whatever the error msg is.

I have been surfing for database repair utilities, but all I seem to be able to find are ones for Access. I would have jumped ship years ago to Access, but some of my assumptions didn't work and it hogged a lot of resources and kept me running out of memory, so I stayed true to dBASE.

Clearly, I will be paying close attention to my new found back-up protocols - you never really do this until you get burned.

To wrap - what about finding dBASE header repair utilities?
I appreciate your posting and guidance. Many thanx!

pds/dallas
 
Make a backup of the problem file. Open the backup in Excel
 
you have no way of knowing how much I endorse your idea. have uncle bill provide an excel program which will allow me to have two or three million lines, and I will be in hog heaven!

they don't call me Your Excel-ency for nothing!
blush.gif


Regards,
P D Sterling
Dallas TX
 
If all else fails read the file with a byte editor and look at the record where the file stops copying. Compare it to the previous record and see if they are encoded the same. You may be able to salvage the file using this approach. If you can't read the data then there probably problems with the disk allocation table. Another problem is the drive is losing sector integrty if the data has been written over a long period of time. Disk recovery software may be the solution.
 
Okay, I am going to google on the items you mentioned, but not tonight. Many thanks for taking the time to post!
thumbsup.gif
 
Note to BillPSU:

I am trying hard not to ask you to do my work for me. I have a vague idea of what a database file works like, and I have googled for software which could edit the file. The largest file is only 21% available, and I am re-creating the data slowly but surely, but it is painfully slow.

Could you in any way recommend a specific program to act as a byte editor? Additionally, could you recommend file recovery software? My problem in finding such is: everything specifically mentions it is for ACCESS.

BTW: I have tried 1) appending the corrupt file to a new file, 2) opening the file with ACCESS, 3) deleting all indexes and re-creating. No cheer.
mad.gif


Any advice would be gratefully appreciated.

regards,
pds
 
Do a search in Google for sector editor. Its been years since I did any of this type of investigation and I did not have good results. I am not sure how the current operating system read/write data to the disc.
 
you seem to have given me the magic word; I went to Google and found half a dozen - so I will be trying them out very soon. many thanx for a mitzvah in the middle of this terrible heat!
medal.gif
medal.gif
medal.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top