473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why can't I use Database object in code?

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
3 1112
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
"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
Thank you both. Your help is much appreciated.

Randy
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lawrence | last post by:
I posted before, but have now narrowed my problem down to this method. At the start of the method, I test to make sure that I have a resource, a pointer to data returned from a database. This test...
6
by: D Bull | last post by:
I'm trying to use sp_help to get information on my tables. I can use sp_help alone to get a list of objects (including user tables), but when I pass a table name as an argument I get the following...
15
by: Dave | last post by:
Has anyone encountered the error message "Can not open any more databases" and what did you do to solve it? Thanks, Dave
3
by: ET | last post by:
I don't know whats the problem, but after I added functions to first verify, then relink linked tables if not found, now I can't convert that database to MDE format. I can split the database, but...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
6
by: Henry | last post by:
I was trying to derive a class from System.Windows.Forms.ComboBox. My goal was to create a class that loaded its own data. I did not want to create too many objects, so I tried to share a Database...
4
by: brent | last post by:
Currently our application is reading from the web.config, and retrieves a section, "softwareRequirements". Because the section will begin to grow dramatically, I'd like to place it in the SQL...
9
by: charliewest | last post by:
Hello - I have images saved in my SQL SERVER 2000 database. Using ASP.NET (C#) is there any way to temporarily save an image to a session object, and after running some other operations, later...
10
by: jt | last post by:
The program works like this: There is a form with a button. When the form is loaded, a separate thread is started which is retreiving/updating data in the database every x seconds. When clicked...
0
by: bradman1861 | last post by:
hello i am getting a overflow error when I try to run this: here is the error: System.Data.OleDb.OleDbException was unhandled Message="Overflow" Source="Microsoft JET Database Engine" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.