MSQuery: How to Undelete Records and Pack dBASE Files

Last reviewed: March 27, 1997
Article ID: Q119700
1.00 2.00 WINDOWS kb3rdparty kbusage

The information in this article applies to:

  • Microsoft Query for Windows, version 1.0
  • Microsoft Query for Windows 95, version 2.0

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.

  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

  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 kb3rdparty kbusage
Version : 1.00 2.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.