SET DB error Excel VBA

JV63

New Member
Joined
Sep 30, 2009
Messages
44
Hi all. I updated an Access database form an older version and it now has the .accdb extension versus the .mdb.

I updated the VB code where it's pointing to the database but getting an error on the following bolded section. Thinking it's because I converted to .accdb.

idrive = "\\cdtvnas13\ops"
dbname = idrive & "\VERIFY1\DDDSUP3.ACCDB"
Set db = DAO.DBEngine.Workspaces(0).OpenDatabase(dbname)

Anyone know what i should change? I'm thinking something like ADO instead of DAO but not sure what the proper code would be.

Thanks.
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Please remind yourself of the forum rule on cross-posting and be sure to follow it in future.

What is the actual error? If you're using a DAO 3.6 reference, you need to update it to use the Microsoft Office n Access Database Objects library instead.
 
Upvote 0
Cross posting? Not sure what you mean. I don't believe I posted this question in another thread but if I did, I apologize.

I'm getting unrecognized database format for my database string but I know it exists.
 
Upvote 0
You posted in at least one other forum.

Did you change the reference as I suggested?
 
Upvote 0
I unchecked DOA 3.6 and checked Microsoft Office 16 Access Database Engine Object Library that was closest to what you stated.

That worked.

Thank you very much and my apologies for cross posting.
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

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