ACC2000: Compile Error After You Convert Database with Old DAO Code (199064)
The information in this article applies to:
This article was previously published under Q199064 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS
If you open a database that was created in an earlier version of Microsoft Access, and you try to run or to compile code that uses Data Access Objects (DAO), you may receive a compile error.
CAUSE
Versions of Access earlier than Access 2000 can successfully compile and run older syntax. For example, the object model for DAO in Microsoft Access 2.0 is significantly different from the object model for DAO in Access 1.0; however, DAO in Access 2.0 still allows the code from Access 1.0 to compile and run. You do not have to reference a type library. Microsoft Access 7.0 and 97 include the DAO 2.5/3.0 and DAO 2.5/3.5 compatibility type libraries. Access 7.0 and 97 use these libraries by default for converted Access 2.0 databases. Therefore, the older code from Access 1.0 still works in Access versions 7.0 and 97.
Microsoft Access 2000, however, has no compatibility type libraries. Therefore, DAO code that uses some of the older syntax may not run.
RESOLUTION
Update your code to the current DAO syntax.
For more information about and examples of how to update legacy DAO code, in the Visual
Basic Editor, click Microsoft Visual Basic Help on the
Help menu, type "DAO Object Library Compatibility" in the Office Assistant or
the Answer Wizard, and then click Search to view the topic.
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kberrmsg kbprb KB199064 |
---|
|