0

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Was `Sales.accdb` made in Access 2007 or later and do you have Access 2007 or later installed on the same machine? – Slai Aug 28 '16 at 15:39
  • or you can set the Target CPU to x86 – Slai Aug 28 '16 at 15:41
  • I had a similar problem like this before, I downloaded this and was on my way https://www.microsoft.com/en-us/download/details.aspx?id=13255 I downloaded the 32bit even though my system is 64bit – user1234433222 Aug 28 '16 at 17:06
  • I have Office 365 64-bit which includes Access, and I have Visual Studio Community on the same machine. I created the database in question on the same machine. I may not be understanding something, but since I already have Office, then would it make sense to download the Redistributable as you suggest? Will that cause me other problems? Thanks – James R. Brown Aug 28 '16 at 19:32

3 Answers3

1

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.

0

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

Community
  • 1
  • 1
Bozhidar Stoyneff
  • 3,576
  • 1
  • 18
  • 28
  • Well, that made a lot of sense and I thought sure that was it. So I went to microsoft.com/en-us/download/details.aspx?id=50040 and downloaded the 2016 Runtime. Was that the right file? Unfortunately, when I tried to install, I got this; We're sorry, Microsoft Office installer encountered a problem because you have these Click-to-Run installer based Office programs installed on your computer: Microsoft Office 365 - en-us Windows Installer and Click-to-Run editions of Office programs don't get along for this version, so you can only have one type installed at a time.. – James R. Brown Aug 28 '16 at 20:06
  • All I wanted to do was write some small programs that would connect to an Access database I created using Access in Office 365. From what I can find out, it appears now that **It can't be done.!** because this requires that Visual Studio still needs the correct MS Access DB Engine. When I try to install the 2016 runtime I get the error that says 'We're sorry, Microsoft Office installer encountered a problem because you have these Click-to-Run installer based Office programs installed on your computer:' I hope I am merely mistaken. – James R. Brown Aug 28 '16 at 20:24
  • Sorry for the late response - I was on vacation. Well, if the creator says so, it wont working then it will not work; maybe there is a hack or something to make them run side-by-side, but the other possible solutions are more feasible to me - can you make a VM and install just what you need for that project? Hyper-V is part of Windows 8 and above so you can just enable it and create the VM within your working PC... – Bozhidar Stoyneff Sep 09 '16 at 08:00
  • Thank you very much. I did not think about using a VM. Sounds like a very interesting solution. One other solution is to convert the accdb to an mdb database and then it would likely work. Thank you for your help. – James R. Brown Sep 10 '16 at 13:32
  • ( cc: @JamesRBrown ) re: edit to answer - Are you *sure* that the Access Database Engine cannot be installed alongside Office 365? It sounds like the problem was with trying to install the Access 2016 **runtime**, which is not the same thing. – Gord Thompson Sep 11 '16 at 13:38
  • ( cc: @JamesR.Brown ) Also, [this Microsoft KB article](https://support.microsoft.com/en-ca/kb/2874601) may be of interest. – Gord Thompson Sep 11 '16 at 16:05
  • 1
    Thank you Gord Thompson for straightening me out on the difference between the Access Database Engine and the Access 2016 runtime. I was confused. Installing that was not without it's problems either. I installed AccessDatabaseEngine_X64.exe. When I tried to connect, I still got the error message, "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." I uninstalled that and installed the 32 bit version and Success!! The Access DB Engine can and does run side-by-side with Office 365.. – James R. Brown Sep 14 '16 at 10:51
0

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.

Petr Kosvanec
  • 115
  • 1
  • 7