Database Repair

When you are using the Microsoft Access driver, if a client failure occurs during the commit process (after SQLTransact has been issued, but before the function returns), you may need to repair the affected database. You can repair a database either through the Setup dialog box for a Microsoft Access data source, or programmatically by using the SQLConfigDataSource function. When repairing a password-protected file, you must enter a password and a user ID in the Set Advanced Options dialog box displayed from the ODBC Setup dialog box (or in the list of attributes for SQLConfigDataSource, if you are repairing the database programmatically).

These operations run the standard Microsoft Jet repair process on the database. Data in Microsoft Access databases could be affected by this operation.

To repair the database programmatically, include REPAIR_DB=pathname in the list of attributes (lpszAttributes argument) of the SQLConfigDataSource function. In this function, pathname is the full path to the Microsoft Access database.