KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

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

Article: Q294966
Product(s): Microsoft Visual Basic for Windows
Version(s): 5.0,6.0
Operating System(s): 
Keyword(s): kbJET kbVBp500 kbVBp600 kbGrpDSVBDB kbDSupport
Last Modified: 17-OCT-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Visual Basic Enterprise Edition for Windows, versions 5.0, 6.0 
- Microsoft Visual Basic Professional Edition for Windows, versions 5.0, 6.0 
- Microsoft Access 2000 
- Microsoft Access 97 
-------------------------------------------------------------------------------

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.

MORE INFORMATION
================

Steps to Reproduce Behavior
---------------------------

1. Create a new standard EXE project in Visual Basic.

2. From the Project menu, click Reference, and then click "Microsoft DAO 3.51
  Object Library".

3. Paste the following code in the code window:

  DbEngine.RepairDatabase

  Notice that RepairDatabase is available in the list of methods.

4. Change you project reference to Microsoft DAO 3.6 Object Library.

5. Paste the following code in the code window:

  DbEngine.RepairDatabase

  Notice that RepairDatabase is not available from the list of methods.

REFERENCES
==========

For additional information, click the article numbers below to view the articles
in the Microsoft Knowledge Base:

  Q230727 INFO: Visual Studio 6.0 SP3 Readme: Part 4 - Visual C++

  Q230501 HOWTO: Compacting Microsoft Access Database via ADO

Additional query words:

======================================================================
Keywords          : kbJET kbVBp500 kbVBp600 kbGrpDSVBDB kbDSupport 
Technology        : kbVBSearch kbAudDeveloper kbAccessSearch kbZNotKeyword6 kbAccess2000 kbAccess97 kbZNotKeyword2 kbVB500Search kbVB600Search kbAccess2000Search kbVB500 kbVB600 kbAccess97Search
Version           : :5.0,6.0
Issue type        : kbprb

=============================================================================

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.

Copyright Microsoft Corporation 1986-2002.