Microsoft KB Archive/294966

= PRB: RepairDatabase Method Is No Longer Available in DAO 3.6 =

Article ID: 294966

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Access 2000 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q294966



SYMPTOMS
If you issue a DbEngine.RepairDatabase method after you change your project references from Microsoft DAO 3.51 Object Library to Microsoft DAO 3.6 Object Library, you may receive the following error message:

Error # 3251 was generated by DAO.DbEngine.

Operation is not supported for this type of object.

Or, you may notice that the method is not available through IntelliSense when you issue a DbEngine.RepairDatabase method.



CAUSE
In Data Access Object (DAO) 3.6, the RepairDatabase method is no longer available or supported. This is by design to match Microsoft Jet 4.0.



RESOLUTION
If you need this functionality, you can use the CompactDatabase method, which also repairs a Microsoft Jet database.



Steps to Reproduce Behavior
 Create a new standard EXE project in Visual Basic. From the Project menu, click Reference, and then click Microsoft DAO 3.51 Object Library.  Paste the following code in the code window: DbEngine.RepairDatabase Notice that RepairDatabase is available in the list of methods.  Change you project reference to Microsoft DAO 3.6 Object Library.  Paste the following code in the code window: DbEngine.RepairDatabase Notice that RepairDatabase is not available from the list of methods. </ol>

<div class="references_section">