Using the Pervasive Btrieve Maintenance Utility
To Repair Corrupted CAP Files
09/05/2008
Sometimes there are situations where the standard rebuild options (Pervasive Rebuild wizard or the Pervasive command-line rebuild utility) do not seem to work to repair corrupted data. In such cases, there is another utility available that may get the job done.
The Pervasive Btrieve Maintenance Utility contains a Copy function that allows you to copy the contents of one file into another file. The procedure for repairing CAP data using the Btrieve Maintenance Utility in Pervasvie SQL follows:
1. Rename the CAP file in question.
- Open a command window by clicking on Start è Run and typing CMD into the open text box. Click the ‘OK’ button.
b. At the command prompt, type “cd c:\sw” (without the quotation marks) and press the enter key. The typical data path on the server is c:\sw. If the location of your data directory is different, type in that path rather than “c:\sw.” For instance “cd c:\posdata” or “cd c:\swdata.”
c. At the command prompt, type the following command to rename the file you are attempting to repair. In this example, we will use the invt1.cap file.
Type “ren” and then the file you are attempting to rename. On the same line, type the name to which you are changing the original file. In the example, invt1.cap is being renamed to invt1.bak. You must include a space between ren and the source file name and a spacke between the source file and the new file name.
Press the enter key once you have correctly typed the rename command.
If you get no feedback from the command window, you have successfully renamed the file.
Once the file is successfully renamed, type the word “exit” and press the enter key. Do not type the quotation marks.
2. Start CAP POS. When the login screen appears, click on the ESC button. A new, empty file is created to replace the one you renamed. In the example above, a new INVT1.CAP file is created.
3. Click on “Start è Programs è Pervasive SQL è Other Utilities è Maintenance
4. The Btrieve Maintenance Utility opens.
5. Click on the “Data” menu. Next, click on the “Copy” option.
6. Click on the Top Browse button and browse to the data path (in this example, c:\sw) and double click on the renamed data file (in this example, invt1.bak).
7. Click on the bottom Browse button and browse to the data path and double-click on the new, empty file (in this case, INVT1.CAP).
8. Click on the “Execute” button. A successful copy data operation will produce a message similar to the following:
You can then test your file to determine if the corruption has been corrected.