I think it might be the other way around. That syntax looks like it is for DAO, not ADO. You would need to have a DAO reference selected, and, you should also declare your recordset specifically as a DAO Recordset.
Dim rstPers as DAO.Recordset
Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886 As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
Tom,
It seems like you may be trying to open an ADO recordset with the DAO OpenRecordset method. Like maybe you have references to both ADO and DAO in your project, and it started defaulting to the wrong recordset type.
Try explicitly declaring rstPers object library like this:
Dim rstPers as DAO.Recordset
Tom,
Just a guess, but if you have installed any Office component or update, or installed a new version of the MDAC (which could be installed with VB.Net, Visual Studio, or MANY other applications, or as a standalone update), that could have changed the order of the libraries in the registry. It's not a large leap from there to seeing how, when something is declared as just plain old recordset (without the qualifier DAO or ADODB), that it would just grab the first one it comes to and go with that.
You will see that effect if you key in:
Dim rs as
then hit the space bar and get a dropdown list of all of the different variable/object types. If you scroll down the list, you will probably see:
Recordset
Recordset
These are the ADODB and DAO recordsets, but you have no way of knowing which is which, or which you will get when you declare a Recordset unless you specify the type of Recordset in the declaration.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.