Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 115779 - Last Review: November 18, 2003 - Revision: 2.0
BUG: Compacted 1.1 DB Becomes 2.0 DB w/ Compatibility Layer
This article was previously published under Q115779
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.
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.
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.
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.
Steps to Reproduce Problem
The following steps reproduce the problem if the Compatibility Layer is
installed on your computer:
- Start a new project in Visual Basic. Form1 is created by default.
- Add a command button (Command1) to Form1.
- 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
- 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.
APPLIES TO
- Microsoft Visual Basic 3.0 Professional Edition
- Microsoft Access 2.0 Standard Edition
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please