By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

Why can't I use Database object in code?

P: n/a
Can anyone tell me why I can use
Dim dbs As Database
in a sub or function in a module?

I get an compile error pointing to this line saying "user-defined type
not defined."

The auto-complete doesn't even have Database as a choice. It begins
with DataAccessPage.

Thanks for any response.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Go to Tools.. References and make sure DAO is checked.

Anne

"RBohannon" <ra*****@hotmail.com> wrote in message
news:ad**************************@posting.google.c om...
Can anyone tell me why I can use
Dim dbs As Database
in a sub or function in a module?

I get an compile error pointing to this line saying "user-defined type
not defined."

The auto-complete doesn't even have Database as a choice. It begins
with DataAccessPage.

Thanks for any response.

Nov 13 '05 #2

P: n/a
"Anne Nolan" <an***************@AOL.COM> wrote in message
news:2l************@uni-berlin.de...
Go to Tools.. References and make
sure DAO is checked.

And, be sure to qualify the references to objects that are common to ADO and
DAO, for example:

Dim rs as DAO.Recordset
Dim qd as DAO.QueryDef

You may, but don't have to qualify the Database object, as there is no such
object in ADO. I use the qualifying DAO.Database just for clarity for anyone
who comes along to maintain the database after me.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #3

P: n/a
Thank you both. Your help is much appreciated.

Randy
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.