问题
Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
and
Microsoft.JET.OLEDB.4.0' provider is not registered on the local machine.
are both errors for me. I've been trying both while trying to create an Access connection. I'm not sure what to do anymore.
I have 32 bit office on a 64 bit machine. I found solutions where they said to install the Access Database Engine but it won't let me install 64 bit with 32 bit office. Another source mentioned to bypass this you can go into command line and do $> AccessDatabaseEngine_X64.exe /passive
but passive isn't recognized as a command.
I found another potential solution which said to download Office system driver and components then add the access database as a source but that didn't work either. I'm running out of ideas it would be greatly appreciated if someone could help.
Links to articles I'm referring to:
- Microsoft.ACE.OLEDB.12.0 provider is not registered
- http://blog.codefluententities.com/2011/01/20/microsoft-access-database-engine-2010-redistributable/
回答1:
If you already have 32-bit Office installed then you're pretty much stuck with the 32-bit version of the Access Database Engine (a.k.a. "ACE"). As you have found, there is supposedly a way to force 64-bit ACE onto a machine that already has 32-bit Office components on it, but personally I wouldn't "go there".
So, you need to configure your C# project to run as 32-bit. You can do that by choosing Platform: x86
on the Build tab of the project's Properties:
(That screenshot was taken on a 32-bit virtual machine, so the default configuration was already 32-bit. The default setting on 64-bit machines should be "Any CPU".)
To verify the environment in which the process is running you can use
String.Format("I am running as {0}-bit.", IntPtr.Size * 8)
For example, in a Windows Forms application you could use
MessageBox.Show(String.Format("I am running as {0}-bit.", IntPtr.Size * 8));
That should display
I am running as 32-bit.
回答2:
sounds like you need to install 64 bit office
http://social.msdn.microsoft.com/Forums/en-US/1d5c04c7-157f-4955-a14b-41d912d50a64/how-to-fix-error-the-microsoftaceoledb120-provider-is-not-registered-on-the-local-machine?forum=vstsdb
来源:https://stackoverflow.com/questions/19684709/making-a-connection-with-ms-access