The information in this article applies to:
SYMPTOMSWhen you run a macro that uses the ADODB object, you may receive an error message similar to the following:
CAUSEThis problem will occur, when you do the following:
-and- For example,
Note: This problem does not occur when you use the DAO object, and the ActiveX library is referenced ahead of the DAO library.
WORKAROUNDTo correct this problem, use either of the following methods. Method 1: Remove the reference to DAOIf you do not need the reference to Microsoft DAO 3.6 Object Library, do the following to remove the reference:
Change the Priority of the ADO ReferenceChange the priority in which the ADO object library is referenced by placing the reference to Microsoft ActiveX 2.1 before the Microsoft DAO 3.6 Object Library.To change the priority, follow these steps:
STATUSMicrosoft has confirmed this to be a problem in Microsoft Office 2000. MORE INFORMATIONIn Microsoft Visual Basic, you can reference both the Microsoft DAO 3.6 Object Library (DAO) and Microsoft ActiveX Data Objects 2.1 Library (ADO) in a single project. The library for DAO is dao360.dll and for ADO, msado15.dll. However, if you reference both libraries in the same project, Visual Basic may not refer to the correct library when you make the connection or create the recordset object, because both libraries contain similar object names. To avoid these kinds of problems, you can use the program ID name contained in the object library when you declare variables in your project. However, creating a reference to both libraries requires that you reference ADO before the DAO library. The following examples create a variable for a recordset in both DAO and ADO using the program ID object:
Additional query words: XL2000
Keywords : kbprg kbdta kbdtacode OffVBA kbADO KbVBA |
Last Reviewed: July 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |