reference to DAO object causes 'User-defined ttype not defined' error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a 'complete' installation of Access 2002. When I run a simple code lik
Sub proba(
Dim dbsExample As DAO.Databas
Set dbsExample = OpenDatabase("Biblio.mdb"
End Su
(I tried both DAO.Database and Database
I get 'Compile error: 'User-defined type not defined' error message. What do I need to do to enable DAO
Thank you very much
 
Have you installed Microsoft DAO Object Library in your .mdb?
If not, go to the VB editor screen, menu Tools > References, scroll down to
find the Microsoft DAO 3.51 Object Library or Microsoft DAO 3.6 Object
Library and select it. This should solve your problem.

HTH,
Nikos
 
Further to the other replies, all methods of the Dbengine object
(including but not limited to Opendatabase) should be explicitly
qualified with that object name; ie. DBENGINE.Opendatabase. Otherwise,
strange DAO licencing & other errors can occur in certain cases. This
was certainly true with A97. I am assuming that it is still true in
later versions.

HTH,
TC
 
Back
Top