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

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
 
N

Nikos Yannacopoulos

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
 
T

TC

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
 

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