Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Database corrupt question
Message
From
22/05/2001 23:32:23
 
 
To
22/05/2001 21:33:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00510155
Message ID:
00510190
Views:
36
>Hi,
> I wish to build a small database corrupted recover program.
>But there have some question i want to ask, hope someone can help.
>1)if the index file corrupted and table still can open, is it i can retrieve the index file structure from the table and rebuild/recreate corrupted index file ?
>
>2)If table is corrupted, can open table, what can i do ? Is it i can overwrite the database .dbc file and solve this problem ?
>
>3)Is it the database .dbc will keep all the tables structure? Any corrupted can solve by just overwrite the database .dbc file ? Because i did heard that someone can do that to solve corrupted problem but i am not sure what kind of corrupt is that.
>
>4)If user didn't close the application properly or reboot/restart/shotdown the windows during the database is open, is that use scan disk will prevent database corrupt?
>
>thanks
>
>kengwen


Rather than try to answer your questions, let me propose a simple approach to dealing with corrupt tables. (There are other good approaches that I won't describe here -- see FoxFix and Stonefield products.)

1) (VERY IMPORTANT!) Make sure that you have a complete copy of all of your tables and the DBC in a separate directory (EMPTY). Zap all of the tables in EMPTY so that they have no records.

2) Get the Recover program by Abri Technologies.

3) If a table (MYTABLE) is corrupted, first make a copy of it (all parts) in a SAVE directory so that you can at least get back to where you are.

4) Run the Recover program against the corrupted table. This will insure that you can read all or most of the data in the table.

5) Copy the data to a temporary DBF file (MYTEMP.DBF). Don't worry about the indexes.

6) Now copy the original uncorrupted empty table from your EMPTY directory using Windows or DOS right over the corrupted table. Make sure that you copy all of the parts of the table (DBF, CDX, FPT).

7) In the FoxPro command window Use MYTABLE again. It should be a good table with no records.

8) APPEND from MYTEMP.

9) On rare occasions I have had to copy the fixed corrupted table to a comma delimited file and then APPEND from that.


Any questions?


Peter Robinson
Peter Robinson ** Rodes Design ** Virginia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform