Database Object Missing(?)

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hello,

I am writing some VBA code in Access 2000 and came across a new one.

I wrote:

Dim CurDb as Database

the compiler flags the line saying 'User-defined type not defined.'
What gives? The help lists the Object 'Database' and CurDb is not a keyword
(I tried MyDb as well, same result).

I then launched Object Browser, it's not in there either. Why would this
change? I have other databases that use it as a definition and they still
work fine.

I'm perplexed!

TIA,

Gary
 
Hello,

I am writing some VBA code in Access 2000 and came across a new one.

I wrote:

Dim CurDb as Database

the compiler flags the line saying 'User-defined type not defined.'
What gives? The help lists the Object 'Database' and CurDb is not a keyword
(I tried MyDb as well, same result).

I then launched Object Browser, it's not in there either. Why would this
change? I have other databases that use it as a definition and they still
work fine.

Access 2000 and AccessXP default to providing a reference to ADOX
(ActiveX Data Objects) - but NOT to DAO. The Database object is a DAO
object but does not exist in ADOX.

Select Tools... References; unless you're also using ADO, uncheck the
ActiveX Data Objects reference. Scroll down to Microsft DAO x.xx (pick
the highest version if you have more than one) and check it.

John W. Vinson[MVP]
(no longer chatting for now)
 
John Vinson said:
Access 2000 and AccessXP default to providing a reference to ADOX
(ActiveX Data Objects) - but NOT to DAO. The Database object is a DAO
object but does not exist in ADOX.

Select Tools... References; unless you're also using ADO, uncheck the
ActiveX Data Objects reference. Scroll down to Microsft DAO x.xx (pick
the highest version if you have more than one) and check it.

John W. Vinson[MVP]
(no longer chatting for now)

Thanks John. That did the trick! I appreciate the help!

Gary
 
Back
Top