ADO Issue

Sully38

Board Regular
Joined
Mar 9, 2004
Messages
167
I am using Access 2002 on Windows XP

When trying to code the following ADO Code

Dim MYDB as Database ... Database is not a valid option to choose. I have coded this line in the past with Access without problem. Has this changed ? If so can this be added to my options or is there a new equivalent to it?

:rolleyes:
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
This is actually DAO code, not ADO code. What you need to do is to open a Module, go to Tools, References, and set a Reference to the DAO 3.51 (or above) library. Because the Object Models are so similar, you'll either want to move this Reference in priority above the ADO reference or remove the ADO reference completely.
 
Upvote 0
Your fix worked like a charm, you are indeed and Access Guru.. May I ask what the ADO equivalent would be to dim as database?
 
Upvote 0
It's been a few months since I've worked with ADO (DAO is just so much simpler), but I seem to remember that in ADO you have a Connection String property:

Code:
dim conn as ADODB.Connection
conn.ConnectionString=CurrentProject.Connection

*edit* actually, I think that conn is an object that you'd need to set first:
Code:
dim conn as ADODB.Connection
Set conn=new ADODB.Connection
 
Upvote 0

Forum statistics

Threads
1,221,638
Messages
6,160,994
Members
451,682
Latest member
ogoreo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top