Cannot open ADO connection to Access 2007 accdb

M

Marcia

Hi,

I am trying to convert a VBA project written in Access 2003 to Access 2007.
I have converted all of the mdbs involved to accdb format. Now, when the
code to relink tables using ADOX or open tables as recordsets using ADO runs,
it fails with the error, "Unrecognized database format". I have updated the
ADO and ADOX references to the latest version, which appears to be 6.0. (I am
running this on Vista, BTW.) Previously, it was using 2.8. Neither
reference results in success. Is it the case that ADO/ADOX do not currently
work in Access 2007? Or is there a setting I can change that will result in
a successful connection?

Thanks,
Marcia
 
D

Douglas J. Steele

Are you creating your own Connection object, or simply using the
CurrentProject.Connection one?

If you're creating your own, what connection string are you specifying?
 
R

RoyVidar

Marcia said:
Hi,

I am trying to convert a VBA project written in Access 2003 to Access 2007.
I have converted all of the mdbs involved to accdb format. Now, when the
code to relink tables using ADOX or open tables as recordsets using ADO runs,
it fails with the error, "Unrecognized database format". I have updated the
ADO and ADOX references to the latest version, which appears to be 6.0. (I am
running this on Vista, BTW.) Previously, it was using 2.8. Neither
reference results in success. Is it the case that ADO/ADOX do not currently
work in Access 2007? Or is there a setting I can change that will result in
a successful connection?

Thanks,
Marcia

Check out the connection string
http://www.connectionstrings.com/?carrier=access2007
 
M

Marcia

Hi Doug,

I am using a connection string that connects to the backend database file:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyData\MyData.accdb

Thanks,
Marcia
 
D

Douglas J. Steele

That's for MDBs: for ACCDBs, you need to use

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyData\MyData.accdb;Persist
Security Info=False;
 
M

Marcia

Doug,

Thank you so much for this information. I read several articles on MSDN
about "the new file format in Access 2007" before finally giving up and
posting here. Are there any technical articles for developers on MSDN where
I could have found this information?

Thanks,
Marcia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top