microsoft DAO 3.6 object library not working (1 Viewer)

John thomas

Registered User.
Local time
Today, 12:42
Joined
Sep 4, 2012
Messages
206
Help Please

when try to open a calendar on my database I get the following Message and the calendar will not Open

Dim db As DAO.Database

Dim rs As DAO.Recordset

Dim rsFiltered As DAO.Recordset

Dim StrSQL As String

Dim i As Integer

Plus I get a message box with Compile error user not defined

I built this program aprox 4 years ago on access 2010

Split database 2 front ends now using Microsoft 365

All has been well for all this time then the error occurred but only on one front end .I checked the reference library on that front end and found Dao not loaded checked the box but will not stay checked

So went to other front end and looked at the reference Library Dao is checked and this front end continues to work .So decided to uncheck Dao and See what would happen ,Sure enough the same problem occurred .So I rechecked the dao box in the reference library ,but it will not allow me to check it again so now I have the problem on both front ends
 

Ranman256

Well-known member
Local time
Today, 15:42
Joined
Apr 9, 2015
Messages
4,339
sometimes an update will alter the REFERENCES.
enter VBE (alt-F11) , tools, references,
see if a checked item says MISSING.
uncheck the missing item,then scroll down to find the new version. check it.
 

isladogs

MVP / VIP
Local time
Today, 20:42
Joined
Jan 14, 2017
Messages
18,209
The old DAO reference was long ago superceded by the standard Microsoft Office xx.0 Access database engine object library (ACDEDAO.dll)
where xx corresponds to the Access version number e.g. 16.0.

You should be using the newer reference instead. It is installed by default in every new ACCDB database created
 

Ranman256

Well-known member
Local time
Today, 15:42
Joined
Apr 9, 2015
Messages
4,339
Theres really no reason to use DAO ,nor ADO in access.
the db has access to all tables/queries via CurrentDB.
No need to write code, Why do you need them?
 

John thomas

Registered User.
Local time
Today, 12:42
Joined
Sep 4, 2012
Messages
206
The old DAO reference was long ago superceded by the standard Microsoft Office xx.0 Access database engine object library (ACDEDAO.dll)
where xx corresponds to the Access version number e.g. 16.0.

You should be using the newer reference instead. It is installed by default in every new ACCDB database created
Thank you for your help i have loaded that reference but still will not work do i need to alter the code were it refers to DAO
 

John thomas

Registered User.
Local time
Today, 12:42
Joined
Sep 4, 2012
Messages
206
Theres really no reason to use DAO ,nor ADO in access.
the db has access to all tables/queries via CurrentDB.
No need to write code, Why do you need them?
thank you for your help
This was written many years ago i have since stopped playing with access and just used the program as it worked brilliantly .My knoledege of access is now not very good now are suggesting rewrite this

Dim rs As DAO.Recordset

Dim rsFiltered As DAO.Recordset

Dim StrSQL As String

Dim i As Integer
 

bastanu

AWF VIP
Local time
Today, 12:42
Joined
Apr 13, 2010
Messages
1,402
Can you please upload a screen shot showing your references and one example of your DAO based code (not just the declarations)?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:42
Joined
Feb 28, 2001
Messages
27,137
What has happened is that when you were using DAO library directly some years ago, that worked - but in one of its (typical) rearrangements of things, MS put DAO into the library that isladogs described to you. If you had DAO library ALSO checked, you would have double references to whatever was in the DAO-specific library.
 

John thomas

Registered User.
Local time
Today, 12:42
Joined
Sep 4, 2012
Messages
206
What has happened is that when you were using DAO library directly some years ago, that worked - but in one of its (typical) rearrangements of things, MS put DAO into the library that isladogs described to you. If you had DAO library ALSO checked, you would have double references to whatever was in the DAO-specific library.
ok i get that which is why i guess it no longer allows me to click it
But how do i get around the problem i tried loading the reference suggested but did not work
Thanks for your help
 

bastanu

AWF VIP
Local time
Today, 12:42
Joined
Apr 13, 2010
Messages
1,402
Did not work like it did not load, it loaded OK but still got compile error,.... not much to go by if you don't show us the references window. Try to import all objects in a brand new file (where the new reference should be loaded by default).

Cheers,
 

isladogs

MVP / VIP
Local time
Today, 20:42
Joined
Jan 14, 2017
Messages
18,209
Access won't allow you to load both the old DAO reference & the newer default library
Your declarations look fine but as stated, you really need to post an example of a procedure using DAO so members can see if there are issues.
You should also be aware that newer versions of Access are less tolerant of 'sloppy coding' than was the case in the past - (please don't be offended by that comment - its not a reflection on you!)
This change was done to make Access more resilient and less subject to crashing!
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 15:42
Joined
May 21, 2018
Messages
8,525
ok i get that which is why i guess it no longer allows me to click it
But how do i get around the problem i tried loading the reference suggested but did not work
Thanks for your help
One of the easiest ways to get all current references is to
1. Create a new blank database
2. Import all the tables into the new database from the old database using the import features on the External Data tab
3. Compact and repair
4. Import all remaining objects Forms, Reports, modules, macros, queries

This is a good process to do routinely on most databases.
 

Users who are viewing this thread

Top Bottom