home *** CD-ROM | disk | FTP | other *** search
- Btrieve Status 30 & File Recovery
-
-
- The first and most preferred option is to use a back-up copy of the
- damaged file. If you choose to attempt to rebuild the File Control
- Record of the Btrieve file, some data may still be lost. You should
- attempt to do a BUTIL -RECOVER <Btrieve file name> <output file name>.
- Then, after creating a new Btrieve file with the same structure as the
- one you are recovering, you can do a BUTIL -LOAD <input file name>
- <new Btrieve file name>, where the Input file name is the same as the
- output file name from the Recover command.
-
- If this does not work, you will need to do the following:
-
- a. Find out how many pages are in your data file. To do this, just
- take the byte size of the file and divide by the page size.
- b. Create a new Btrieve file with the same characteristics as the file
- you want to recover.
- c. Replace the first page of the damaged file with the first page from
- the new file you just created. Remember, a page is however many
- bytes you specified when you created the file - some multiple of
- 512 bytes.
- d. Replace bytes 26 - 29 of this first page (in the damaged file) with
- the hex value representing the number of pages in your damaged file
- that you calculated in step a.
- example: say your file contains 600,000 pages. The hex value for
- this number is 927C0. When entering these values, keep
- in mind that high and low order bytes as well as high
- and low order words get swapped before being stored, so
- you must store your hex values swapped appropriately.
-
- 26 27 28 29
- ---- ---- ---- ----
- Hex bytes 26 - 29: | | | | | | | |
-
- Decimal 600,000 = Hex 927C0: |00| |09| |27| |C0|
-
- First, flip byte 26 with byte 27: |09| |00|
-
- Then, flip byte 28 with byte 29: |C0| |27|
-
- The results are: |09| |00| |C0| |27|
-
- So, 09 00 C0 27 would be the four hex values you would load into
- bytes 26 - 29 to represent 600,000 pages.
-
- e. Now you should attempt the Butil Recover and Load process again.