"Melanie" <mw*****@earthlink.net> wrote in message news:<IU******************@newsread3.news.atl.eart hlink.net>...
In AccessXP(A2000 mode), how do I make the change of references from ADO to
DAO3.6 permanent?
I go into references and uncheck ADO then scroll down to DAO3.6 and check it. I
close references and reopen and DAO3.6 is in the list at the top and checked.
Then I open my database and close it. When I go and look at references, ADO is
back and checked and DAO3.6 is back in the list unchecked. BTW, the database was
designed with DAO3.6 checked on another computer.
Thanks,
Mel
Mel,
I asked this question a while back, and Michael Kaplan said "You can't
make DAO the default. ADO is the default from A2000 on, and it's
hard-coded, so you can't change it as if it were a preference to use
DAO instead of ADO by default.
One way you can get around this (sort of) is to use the
GetReferenceFromFile function (see the help). You'd have to do
something like:
Function RegisterComponents()
On Error Resume Next '--it's okay if one reference is already
registered - just keep going
GetReferenceFromFile("C:\program files\common files\microsoft
shared\dao360.dll")
End Function
then you could call the function in the startup of your code. Of
course, you could get around this by using late binding... and then
your version of DAO wouldn't so much matter, unless you were using a
function that was not in the user's version of the DAO library.
Of course, you'd need to preface any of your DAO-specific code with
the library name... so instead of
Dim db as database
you'd use
Dim db As DAO.Database
This will become critical if you have objects with the same name in
two different libraries, e.g.
Dim rsADO as ADODB.Recordset
Dim rsDAO as DAO.Recordset
HTH,
Pieter
HTH,
Pieter