CdbDBEngine::RepairDatabase Method

Attempts to repair a corrupted Microsoft Jet database (Microsoft Jet databases only).

Syntax

VOIDRepairDatabase(LPCTSTR pstrDatabase);

Parameters

Type Example Description
LPCTSTR pstrDatabase A pointer to a string that contains the path and file name of an existing Microsoft Jet database file. If you omit the path, only the current directory is searched. If your system supports the uniform naming convention (UNC), you can also specify a network path, such as "\\server1\share1\dir1\db1.mdb".

Remarks

All users must close the database before you repair it. If the database isn't closed or isn't available for exclusive use, an error occurs.

Usage

#include <afxole.h>
#include <dbdao.h>
CdbDBEngine   dben;
...                     // Attempt to repair a local database
dben.RepairDatabase(_T("db1.mdb"));