Computing.Net > Forums > Programming > Visual Basic - Public db As Databas

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Visual Basic - Public db As Databas

Reply to Message Icon

Name: sillyman
Date: July 2, 2004 at 01:55:37 Pacific
OS: Win XP + Win 98
CPU/Ram: 1GB
Comment:

I am using the below to declar a database in Visual Basic

Option Explicit
Public db As Database
Public rstInfo As Recordset

But the problem I get is that when I run it it says Database is not a predefined object even though it changes the lower case d to upper case D



Sponsored Link
Ads by Google

Response Number 1
Name: Jezz
Date: July 6, 2004 at 19:49:21 Pacific
Reply:

Make sure that you have the appropriate references to either ADO or DAO loaded in your project.

VB6 defaults to use dao which if you don't have the reference will not work. When declaring use Public dB as DAO.Database or
Public db as ADODB.database.

Likewise with the recordset, if you have the references loaded it will prompt you in VB with a dropdown list as you enter code...

Cheers,
J


Regards,
Jezz


0
Reply to Message Icon

Related Posts

See More


Comboboxes in VBA for Wor... microsoft visual studio ....



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Visual Basic - Public db As Databas

Visual Basic % Professional edition www.computing.net/answers/programming/visual-basic-professional-edition/8400.html

visual basic and access www.computing.net/answers/programming/visual-basic-and-access/3097.html

db and pich in Visual basic www.computing.net/answers/programming/db-and-pich-in-visual-basic/3927.html