Search code examples
pervasivebtrieve

Btrieve file only shows partial data


Almost ready to throw up the white flag but thought I'd throw it out there. I have an OLD program from 1994 that uses a btrieve dB and renders basic membership info for a gym. The btr file that holds the data will open in notepad and I can search and find all records although the formatting is nearly unreadable. When it opens in the program there is a huge chunk of records missing. It seems to stop on specific records up and down when scrolling.

I know almost nothing about btrieve as it predates my IT career by many years and I've honestly never seen it. Any suggestions on where I should troubleshoot or tools that may help would be much appreciated.


Solution

  • This sounds like the file may be corrupted although I would expect errors if it was corrupted. One way to rebuild the file is to use BUTIL (and a couple of OS commands).
    The steps to rebuild are:

    1. Make a backup of the original file to another directory.
    2. Rename the original file. I like to use change the extension to .OLD.
    3. Delete the original file. It will be recreated in the next step.
    4. Issue the BUTIL -CLONE command (BUTIL -CLONE
    5. Issue the BUTIL -COPY command (BUTIL -COPY

    The rebuild is complete. I've use the commands below in the past (changing 'filename' and the extensions to match my files).

    copy filename.btr someother\location\filename.btr 
    ren filename.btr filename.old 
    del filename.btr 
    butil -clone filename.btr filename.old
    butil -copy filename.old filename.btr