且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

'microsoft.ace.oledb.16.0'提供程序未在本地计算机上注册

更新时间:2021-08-20 22:28:39

您必须从Microsoft官方下载中心下载并安装Microsoft Access数据库引擎2010可再发行组件 [ ^ ]至能够在y中使用它我们的项目。
You have to download and install Microsoft Access Database Engine 2010 Redistributable from Official Microsoft Download Center[^] to be able to use it in your project.


一些事情...



首先,您安装了哪个版本的Office 2016?如果它是32位版本的Office,则必须针对x86的平台目标编译您的应用程序,而不是AnyCPU。进入你的项目属性,然后单击Build选项卡,你会在那里找到它。



如果你安装了Office 2016 Click-To-Run,您必须安装单独的Access运行时。如上所述,您可以安装2010版本或2013版本。这没关系。 (如果您尝试安装2016版本,它会告诉您无法安装它,因为您已经安装了2016点击运行。)



完成安装后,您必须更改连接字符串以使用正确版本的ACE引擎。对于Access Runtime 2013,它是'Microsoft.ACE.OLEDB.15.0'。对于Office 2010,它是Microsoft.ACE.OLEDB.14.0。
A couple of things...

First, Which version of Office 2016 do you have installed? If it's the 32-bit version of Office, your application has to be compiled for a Platform Target of x86, NOT AnyCPU. Go into your Project Properties and click on the Build tab, you'll find it in there.

If you've got Office 2016 Click-To-Run installed, you have to install a separate Access runtime. Like above, you can either install the 2010 version or the 2013 version. It really doesn't matter. (If you try to install the 2016 version it'll tell you that you can't install it because you already have 2016 Click-To-Run installed.)

Once you have that install you have to change your connection string to use the correct version of the ACE engine. For the Access Runtime 2013, it's 'Microsoft.ACE.OLEDB.15.0'. For Office 2010, it's 'Microsoft.ACE.OLEDB.14.0'.