If you declare only a Recordset without specifying whether it is a DAO or ADO, Access will determine whether it will be a DAO or ADO, depending on the order of your links:
Open the code window, open "Tools" β "Links" and browse the list. It will look something like this: 
You see that in this example there is a link to DAO ("Microsoft DAO 3.6 Object Library") and ADO ("Microsoft ActiveX Data Objects 2.5 Library").
If you declare your recordset without specifying a type, Access selects the first of these links (= the one that is larger at the top of the list) and creates a recordset of this type.
Therefore, in this example, it will be DAO.Recordset .
Now back to your question:
You declare your recordset without specifying a type.
Therefore, if the first link in your Access database is ADO, Access will create ADODB.Recordset .
Then you open it using the DAO method, which expects DAO.Recordset , and why you get the error.
There are two ways to solve your problem:
- Make sure that the Access database has a link only to ADO or DAO (but not both), then you do not need to specify the type of record set.
- If you really need both links, always list your entries as
DAO.Recordset or ADODB.Recordset to make sure that this is really the type that your code expects.
source share