VB Migration Partner

KNOWLEDGE BASE - Database and data-binding

Previous | Index | Next 

[PRB] The DAO RepairDatabase method causes a compilation error

Starting with version 1.00.06, VB Migration Partner converts all DAO references using DAO 3.6. (Previous versions used DAO 3.51.) This change ensures that Jet 4.0 databases can be accessed in the best way, however it introduces a minor issue because DAO 3.6 doesn’t support the RepairDatabase method any longer. Any reference to this method causes a compilation error in the VB.NET project. For more information, read this Microsoft KB article.

The simplest work around for this issue is a ReplaceStatement pragma that replaces the RepairDatabase with a CompactDatabase method and then copies the compacted database over the old file, as in this example:

     '## ReplaceStatement DAO_DBEngine_DefInstance.CompactDatabase("c:\db.mdb", "c:\db2.mdb"): 
                          System.IO.File.Move("c:\db2.mdb", "c:\db.mdb")
     DBEngine.RepairDatabase "c:\db.mdb"


Previous | Index | Next 

Follow Francesco Balena on VB6 migration’s group on


Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.

Code Architects and its partners offers remote and onsite migration services.

More details

Subscribe to our free newsletter for useful VB6 migration tips and techniques.


To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice

A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial

The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote

Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers