James R. Brown
James R. Brown

Reputation: 21

Cannot connect to Access database

I am trying to access a file stored in a Microsoft Access database (I am working in Visual Studio Community 2015) and I ALSO have Office 365 64-bit version on my machine.

I set the Target CPU under compile to x64. I chose the database source type, and the dataset database model, when it asks me "which data connection should your application use to connect to the database?", I clicked New Connection, then I chose Microsoft Access Database File (OLE DB).

Under database file name, I clicked browse and selected the appropriate file (Sales.accdb). When I press "Test Connection" or Ok I get this error:

Unrecognized database format 'C:.....\Sales.accdb.

Any ideas as to what I am doing wrong?

Upvotes: 0

Views: 5852

Answers (3)

Petr Kosvanec
Petr Kosvanec

Reputation: 119

You need to do it in 32-bit MS Office (Access 2016 AKA Access 365 for now) with the 32-bit Access Database Engine. It works OK. Even though the two componets are both 32-bit, the Office has a small 64-bit installer file in it though, see the screenshot, and that has to be removed first - for how to see this advice.

screenshot

The 64-bit Access 2016 with 64-bit Access Database Engine 2016 produce "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." problem.

Upvotes: 0

Bozhidar Stoyneff
Bozhidar Stoyneff

Reputation: 3634

The presence of the Office 365 is irrelevant - you need the correct MS Access DB Engine. See this SO post for details.

Upvotes: 0

James R. Brown
James R. Brown

Reputation: 21

It turns out that all I had to do was install the correct Access Database Engine which can be found at https://www.microsoft.com/en-us/download/details.aspx?id=13255

It installs and runs works perfectly now. I was apparently confused between the Access Database Engine needed by Visual Studio and the Access 2016 runtime which is a different thing altogether. This was pointed out to me by Gord Thompson.

Upvotes: 1

Related Questions