MSQuery: How to Undelete Records and Pack dBASE Files

ID: Q119700

1.00 2.00 WINDOWS kb3rdparty kbusage

The information in this article applies to:

SUMMARY

Microsoft Query does not include a feature to automatically undelete records from or pack a dBASE file. However, you can use Microsoft Query and the ODBC driver settings to accomplish these tasks.

NOTE: Undeleting a record in a dBASE file is the process of removing the deletion mark from a record in the database file. Packing a dBASE file is the process of removing records from the file that have been marked for deletion.

WORKAROUNDS

Each of the following procedures require that you save a new copy of the original dBASE file. There is no way to undelete or pack the original dBASE file from within Microsoft Query.

Note that this is the recommended procedure for many dBASE-compatible products. This process ensures that your original data stays intact while you perform the operation. If you attempt to perform this process by overwriting the original file, data loss could result if the procedure is unsuccessful for any reason. Microsoft Query DOES NOT allow you to overwrite a file that is currently open.

To Undelete Records

The following process will undelete ALL records that have been marked for deletion. There is no way to undelete individual records.

NOTE: Because there are several versions of Windows, the following steps may be different on your computer. If they are, please consult your product documentation to complete these steps.

1. Ensure that Microsoft Query is not running. This can be

   accomplished by invoking the Task Manager by pressing the CTRL+ESC
   key combination.

2. From Windows Control Panel, double-click the ODBC icon.
   Select a dBASE data source listing. Click the Options button. Turn
   on the Show Deleted Records option. Close Windows Control Panel.

3. Start Microsoft Query, and open the dBASE file in a new or saved query.

4. From the File menu, choose Save As. Select a dBASE data source

   listing and enter a unique filename. Click the OK button.

This procedure will save a new version of the dBASE file containing all the records that were displayed in step 2 above, and none of these records will be marked for deletion. You can now delete or rename the original dBASE file and name the new file with the name of your original file.

To Pack a dBASE File

NOTE: Because there are several versions of Windows, the following steps may be different on your computer. If they are, please consult your product documentation to complete these steps.

1. Ensure that Microsoft Query is not running. This can be

   accomplished by invoking the Task Manager by pressing the CTRL+ESC
   key combination.

2. From the Windows Control Panel, double-click the ODBC icon.
   Select a dBASE data source listing. Click the Options button. Turn
   off the Show Deleted Records option. Close the Windows Control
   Panel.

3. Start Microsoft Query. Open the dBASE file in a new or saved query.

4. Choose Save As from the File menu. Select a dBASE data source

   listing and enter a unique filename. Click the OK button.

You have now saved a new version of the dBASE file that does not include any records that were marked for deletion in the original file. It is now possible to delete or rename the original dBASE file and rename the new file to the name of the original using MS-DOS commands or Windows File Manager.

KBCategory: kb3rdparty kbusage KBSubcategory: xlquery

Additional reference words: 5.00 7.00

Keywords          : xlquery 
Version           : 1.00 2.00
Platform          : WINDOWS

Last Reviewed: May 22, 1998