1

I had a simple VB.NET program running under Visual Studio 2012 that accesses an MSACCESS DB on my machine. It was working fine until I recently upgraded from Windows 7 to Windows 10, and Office 2010 to Office 365. Now when I try to open the DB, I get "Provider cannot be found. It may not be properly installed."

I have a 32-bit version of Office, windows 10 is 64-bit. I've tried both .Net framework 4.5 and 2.0, and ActivX Data Objects 2.7 library and 2.8 library - still have the same problem.

In ODBC drivers (32-bit) I see ACEODBC.DLL (from ODBC data sources) In ODBC drivers (64-bit) under DSN is says MS Access Database 32-bit but I see no driver.

I even tried installing Visual Studio 2015, but that didn't help.

Any ideas on what to try next?

tko
  • 21
  • 3
  • http://stackoverflow.com/q/238625/1070452 – Ňɏssa Pøngjǣrdenlarp Jan 23 '16 at 19:04
  • When you say "I've tried both" do you mean that you have rebuilt your project specifically targeting each of x86 (32-bit) and x64 and verified the environment in your code (e.g., by inspecting `IntPtr.Size`)? – Gord Thompson Jan 23 '16 at 20:32
  • Also, [this MSKB article](https://support.microsoft.com/en-us/kb/2874601) talks about Office 2013 click-to-run but it might apply to Office 365 as well. – Gord Thompson Jan 23 '16 at 20:38
  • What I have done create a minimal Access file with one table. Wrote a simple test with only the following code: xdb = new adodb.connection; xdb.open("Microsoft.Jet.OLEDB.4.0;c:/Testing/FruitDB.mdb"). I get the error on the open. I've rebuilt with net 4.5 and net 2.0 - and always get the error. Interestingly, I have some other code that was compiled and built before my upgrade and it runs fine. But I'm afraid to re-compile until I figure out what went wrong. Do I need a 64-bit ODBC driver if I'm accessing a 32-bit access db? – tko Jan 23 '16 at 22:41
  • Your .NET project must target the x86 (32-bit) environment if you want to use `Microsoft.Jet.OLEDB.4.0` because that provider is only available to 32-bit applications. Access database files (.mdb and .accdb) are just data files and don't have a "bitness" associated with them, but the database *engine* files do. – Gord Thompson Jan 24 '16 at 04:18
  • I've done some more research. If I copy a different project that worked on Windows 7 and Windows 8.1, it works on windows 10 as well. But when I use visual studio to create a new project on Windows 10, I get the provider error. I notice that the bin file on the working version includes many 'Interop.xxx files (ADOR.dll, ADOX.dll and more) as well as Axinterop files. But those are NOT present on the non working version. I assume that's where the problem lies. Any idea on why Windows 10 does not put these in the bin file when I compile? Does it perhaps have something to do with framework? – tko Jan 24 '16 at 18:11
  • It looks like you may be using the older COM references in your project, and perhaps VS on Windows 10 behaves differently in that respect. You could try creating a little project that uses `System.Data.Odbc` or `System.Data.OleDb` (.NET assemblies) instead of "ActiveX Data Objects 2.x library" (COM) and see if that works better. – Gord Thompson Jan 25 '16 at 12:36
  • Thank you, Gord. I'll try that out. In the meantime, I have reverted back to Windows 7. – tko Jan 27 '16 at 20:07

0 Answers0