vb.net - 在 64 位模式下运行时,提供程序 Microsoft.ACE.OLEDB.12.0 未注册,但 Access 64 位存在

标签 vb.net ms-access oledb 32bit-64bit

我的计算机安装了带有 Access 2016 的 64 位 Office 和 32 位 Access 2010 Redistributable。

我的 VB.NET 程序使用 OleDb 类来读取和写入 .accdb 文件中存储的数据。

如果我使用 AnyCPU 选项编译它,它将停止并显示异常,提示“Microsoft.ACE.OLEDB.12.0 提供程序未注册”,除非我设置“首选 32 位”选项。

但是我的整个应用程序将无法从 64 位处理中受益,它将以 32 位运行 (IntPtr.Size = 4)

这是为什么呢? .NET OleDb 类不应该找到 Access 2016 64 位附带的 64 位提供程序吗?

我会感谢任何帮助我理解这里发生的情况并希望指导我修复它的人。

最佳答案

您可能安装了 Office 2016 的即点即用版本。According to Microsoft :

Click-to-Run installations of Office run in an isolated virtual environment on the local operating system. [...] You must install an MSI installation of the Microsoft Access Database Engine from one of the following sources so that the calling application can locate the [Microsoft.ACE.OLEDB.12.0 OLEDB provider].

因此,您有以下选择:

  • 删除 32 位 Access Runtime 并安装,例如 the 64-bit version of the Access 2013 Runtime相反或

  • 坚持使用 32 位。不支持在同一台计算机上同时安装 32 位和 64 位版本的 Microsoft.ACE.OLEDB.12.0 驱动程序。 (是的,这很愚蠢)。或者,

  • 您可能想要切换到另一个数据库(例如 SQL Sever Express 或 SQLite)。将 Office 产品与 64 位结合起来往往会引起很多麻烦。

关于vb.net - 在 64 位模式下运行时,提供程序 Microsoft.ACE.OLEDB.12.0 未注册,但 Access 64 位存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40911275/

相关文章:

c# - 当第一行是字符串时,GetValue() 不读取十进制值

c# - ADO.NET 获取 OleDbSchemaTable

.net - CA1034 : Nested types should not be visible

c# - 如何查看特定字符串的文本文件并将该字符串粘贴到 SSIS/C#/VB 中的变量中

ms-access - 如何查找存在多个属性的表的变化?

ms-access - 使用vba从文本中提取信息

vba - 文本文件源上的 Excel QueryTable 因 Jet OLEDB 连接字符串而失败

asp.net - 向 System.Web.UI.Control 添加样式

c# - 当前安装不支持该项目类型

ms-access - "Query input must contain at least one table or query"错误 - 嵌套查询,MS Access