To work around this problem, use one of the following methods:
Method 1
In the
References dialog box, make sure that
Microsoft Office 2007 Access database engine Object Library is higher in priority than
Microsoft ActiveX Data Objects. To do this, follow these steps:
- Start Access 2007.
- Click the Microsoft Office Button, and then click Open.
- In the Open dialog box, locate and select <DatabaseName>, and then click Open.
- On the Database Tools menu, click Visual Basic in the Macro group to open Visual Basic Editor (VBE).
Note You may also press ALT+F11 to open VBE. - On the Tools menu, click References.
- In the References - <DatabaseName> dialog box, click Microsoft Office 2007 Access database engine Object Library.
- Click the Priority arrow to move Microsoft Office 2007 Access database engine Object Library above Microsoft ActiveX Data Objects, and then click OK.
Method 2
If you must reference and use both DAO and ActiveX Data Objects (ADO) object libraries, dimension the objects explicitly as follows:
Dim adoRS As ADODB.Recordset
Dim daoRS As DAO.Recordset
Method 3
If you are not using an ADO object library, clear the reference to the library. To do this, follow these steps:
- Start Access 2007.
- Click the Microsoft Office Button, and then click Open.
- In the Open dialog box, locate and select <DatabaseName>, and then click Open.
- On the Database Tools menu, click Visual Basic in the Macro group to open VBE.
Note You may also press ALT+F11 to open VBE.
- On the Tools menu, click References.
- In the References - <DatabaseName> dialog box, click to clear Microsoft ActiveX Data Objects, and then click OK.