A2K7: "Turning off" ADO?

L

LarryP

I'm only just starting to dabble in A2K7, including up-migrating a bunch of
A2K3 databases, and I've quickly found that "Method or data member not found"
errors occur frequently. Re-declaring variables as DAO.recordset, etc.,
works in some cases, re-declaring variables as the generic Object works in
others, but I presume this is all due to A2K7's assumption that I'm writing
in ADO.

Just navigating around A2K7 is still a little bewildering, so can anyone
tell me if there's a simple setting somewhere that will turn off ADO and
default to DAO?
 
D

Douglas J. Steele

There should be no difference between Access 2007 and Access 2003 in terms
of precedence of ADO over DAO. There's nothing wrong with disambigulating
your declarations (i.e. As DAO.Recordset or As ADODB.Recordset): I do that
in Access 97, without any reference to ADO! A complete list of objects that
need to be disambigulated is Connection, Error, Errors, Field, Fields,
Parameter, Parameters, Property, Properties and Recordset

However, the answer to your specific question is while in the VB Editor,
select Tools | References from the menu. Uncheck the reference to the
Microsoft ActiveX Data Object 2.x Library
 
L

LarryP

Gee, how simple, guess I was looking for something more arcane. I ws in fact
just fiddling with the references, and tried to add the most current DAO
reference but it said that conflicted with an existing reference. I presumed
that was the ADO reference, so I unchecked that and tried again and still got
the same message. One thing that surprised me is that the original
installation of A2K7 apparently used an older ADO reference, although there
are several available with later version numbers. Odd....
 
D

Douglas J. Steele

Don't know why the particular ADO reference was the one selected, but I
suspect it's to minimize the chance of versioning issues.

As to changing the DAO reference, if you're working with an MDB file, you
must use the Microsoft DAO 3.6 Object Library reference. Only if you're
working with the new ACCDB format can you use the Microsoft Office 12.0
Access database engine reference.
 
L

LarryP

Ah, that sheds a light, since I had upgraded the database in question to
..accdb for testing. So the DAO reference is now imbedded in the Office 12,
therefore it wouldn't let me add the DAO reference as a separate item. I'm a
wiser man, thank you, Doug. As to the ADO reference, I upgraded it to the
latest (2.8 I think) version, will see soon enough whether it blows up in my
face.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top