Access 2000 vs Access 2007 (1 Viewer)

JohnLee

Registered User.
Local time
Today, 11:58
Joined
Mar 8, 2007
Messages
692
Good afternoon Folks,

Can Access 2007 reference action Access 2000 reference objects, i.e.

Microsoft 12.0 Access Database Object Library read and action microsoft DAO 3.6 Object Library.

So for instance I have code written that references the "DAO.Recordset" and also has declarations such as "DB As Database"

Would code written for DAO 3.6 still work in MS Access 2007 modules.

Thanks in advance.

John​
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:58
Joined
Jul 9, 2003
Messages
16,287
Yes... is the short answer.

I haven't got A2007 available at the moment so I can't check, but I think from memory "DAO 3.6" is the version for A2007.
 

JohnLee

Registered User.
Local time
Today, 11:58
Joined
Mar 8, 2007
Messages
692
Hi Uncle Gizmom,

Thanks for your response so do I keep the reference "Microsoft 12.0 Access Database Object Library" or change it to this reference "Microsoft DAO 3.6 Object Library" or can I keep the first reference and it will not complain where I have references to the DAO 3.6 object library.

Regards

John
 

Minty

AWF VIP
Local time
Today, 19:58
Joined
Jul 26, 2013
Messages
10,371
By default if you run a later version than the original I believe it will automatically load the matching version of the references that it needs. It's normally only a problem going backwards. (E.g. open a 2003 db in 2007, the open it again in 2003...You then lose the references)
 

JohnLee

Registered User.
Local time
Today, 11:58
Joined
Mar 8, 2007
Messages
692
Hi Minty,

Thanks for the clarification.

Regards

John
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:58
Joined
Jul 9, 2003
Messages
16,287
If you are using both on the same machine (this is not uncommon because access have played about with it) Once they wanted to use DAO it was always going to be DAO, then it was going to be I ADO and now it's both DAO and ADO. Some ADO - DAO code is very similar and MS Access can get confused as to which model to use; so if you get some strange results it could be this. The safest thing to do is prefix your declaration with ADODB and DAO where appropriate.

As to references, I think (not sure) you need a reference to Microsoft ActiveX Data Objects 2.8 Library.
 
Last edited:

JohnLee

Registered User.
Local time
Today, 11:58
Joined
Mar 8, 2007
Messages
692
Good day Ungle Gizmo,

Thanks very much for that information. I'll check the references accordingly.

Regards

John
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 19:58
Joined
Sep 12, 2006
Messages
15,661
I would not change the vba libraries without good reason.

I do not think there is any need to specifically link to the DAO 3.6 library, for versions of access after A2003, as they include all this in other libraries.

Including DAO 3.6 is likely to produce ambiguity errors, not remove them.

-----
where the problem can arise if you create a dbs in A2000, (or A2003). The references are set correctly. If you THEN open the same DBS with A2007 or later, the references are automatically corrected to be compatible with A2007

If you THEN go back to A2000 again, the dbs will not work, because it cannot automatically downgrade the references

-----
with regard to DAO/ADO - access will try to use the libraries in the order they are specified, if the function is not disambiguated.

So DAO is generally the default and set rst = db.openrecordset("") etc will open a DAO recordset.

However, if you add a reference to ADO, and move the reference UP the reference list so it is ABOVE the DAO library, access will now try to create a ADO recordset as first choice.
 

JohnLee

Registered User.
Local time
Today, 11:58
Joined
Mar 8, 2007
Messages
692
Thanks Gemma,

I currently have a db in Access 2000 which I am moving to Access 2007, I noted that Access 2007 will not allow references to DAO 3.6 because of this reference was already reference : "Microsoft 12.0 Access Database Object Library" which is why I asked my question, I believe it has been answered by the other responses and I have a way forward now. However I may have some other questions, but I'll post in this forum when they come to mind.

Thanks

Regards

John
 

Users who are viewing this thread

Top Bottom