为了使用“Microsoft.ACE.OLEDB.12”,您需要安装“Microsoft Access Database Engine 2010 Redistributable”
信息页面在这里:
http ://www.microsoft.com/en-us/download/details.aspx?id=13255
正如@user1297578 非常正确地指出,实际下载在这里:
http ://www.microsoft.com/en-in/download/confirmation.aspx?id=13255
一旦你安装了它,实际的程序集就会被调用ACEOLEDB.DLL
,命令提示符下的以下命令会在你的系统上为你找到它:
C:\>DIR /s/b c:\ACEOLEDB.DLL
c:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL
作为参考,以下是我在安装上述可再发行组件之前从程序收到的错误消息:
Connection Failed.
Error from IDataInitialize::GetDataSource
with connectionString=Data Source=C:\MyFileName.mdb;Mode=Share Deny Write;Provider=Microsoft.ACE.OLEDB.12.0;User Id=admin
OLE DB Error Report:
ErrorRecord:
Hresult=80040154
Description: Class not registered
SQLErrorInfo: No error info available
Source: Microsoft OLE DB Service Components