BUG: Compacted 1.1 DB Becomes 2.0 DB w/ Compatibility Layer

ID: Q115779


The information in this article applies to:


SYMPTOMS

Error 3041 "Incompatible database version" is the result when you use the Microsoft Access 2.0/Visual Basic 3.0 Compatibility Layer to open a Microsoft Access version 1.1 database that was compacted by using the CompactDatabase statement with the DB_VERSION10 option.


CAUSE

According to the README.TXT file for the Compatibility Layer, after installing the Compatibility Layer, the CompactDatabase statement in Visual Basic version 3.0, when used with the DB_VERSION10 constant (from the file DATACONS.TXT), is supposed to generate a Microsoft Access version 1.1 database. The following table shows which type of database is supposed to be created when you use CompactDatabase with and without DB_VERSION10:


------------------------------------------------------------------
Jet Database Engine   Creates by Default      With DB_VERSION10
------------------------------------------------------------------
Version 1.1           Version 1.1 database    Version 1.0 database
Version 2.0           Version 2.0 database    Version 1.1 database 
However, this is not what happens. There is a bug in the Compatibility Layer that causes the CompactDatabase statement to always create a Microsoft Access version 2.0 database regardless of the existence of the constant DB_VERSION10 as an option. Both the Office Development Kit (ODK) and Access Developer's Toolkit (ADT) versions of the Compatibility Layer have this problem.


WORKAROUND

Use Microsoft Access version 1.1 or 2.0 to compact a version 1.1 database instead of using the CompactDatabase statement from the Compatibility Layer.

NOTE: Once a database is in Microsoft Access version 2.0 format, you cannot convert it back to Microsoft Access version 1.1 format directly. If you used CompactDatabase and ended up turning a version 1.1 database into a version 2.0 database, you need to restore the version 1.1 database from a backup copy, or rebuild it by extracting the information from the newly compacted version 2.0 database and placing it into a new version 1.1 database.

WARNING: If the Compatibility Layer has been installed and you're using a Microsoft Access version 1.1 database with a Visual Basic application, NEVER use CompactDatabase on the version 1.1 database if you want it to remain in version 1.1 format. Instead, use Microsoft Access itself to compact version 1.1 databases.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

Steps to Reproduce Problem

The following steps reproduce the problem if the Compatibility Layer is installed on your computer:

  1. Start a new project in Visual Basic. Form1 is created by default.


  2. Add a command button (Command1) to Form1.


  3. Place the following code in the Command1 Click event procedure:
    
       Sub Command1_Click ()
          Const DB_VERSION10 = 1               'Microsoft Access Version 1.1
          Const DB_LANG_GENERAL = ";LANGID=0x0809;CP=1252;COUNTRY=0"
    
          ' The following should compact a 1.1 Database into a 1.1 Database.
          ' But it actually compacts a 1.1 Database into a 2.0 Database.
          ' Enter the following code as one, single line:
          CompactDatabase "C:\VB\BIBLIO.MDB", "C:\VB\NEWBIB.MDB",
             DB_LANG_GENERAL, DB_VERSION10
       End Sub 


  4. Press the F5 key to run the program, and click the Command1 button. This results in an "Incompatible Database Version" error if the resulting compacted database, which is now in Microsoft Access version 2.0 format, is used on a computer that does not have the Compatibility Layer installed.


Additional query words: buglist3.00 3.00 buglist3.00


Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: June 30, 1999