积极答复者
未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序 问题

问题
-
VB.NET 数据\添加数据源,选 Microsoft Access 数据库文件(OLE DB),选 .accdb 文件出现
未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序选 .MDB 数据库文件又正常
但用代码连接 .accdb 又正常:
Dim CNN As New ADODB.Connection
Dim RS As New ADODB.Recordset
Dim I As Integer
CNN.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & System.Environment.CurrentDirectory & "\AAA.accdb;"
CNN.Open()系统为 Win7 x64, 也装了 AccessDatabaseEngine_X64 也不行。
编译平台设置 Any CPU、x86 都试过没用。
请教如何解决? 是不是 x64系统不能连接 accdb 外部数据库啊?
答案
-
你好
你的OFFICE 是那一個版本的
E.G. OFFICE 2010/ OFFICE 2007
我之前也有差不多的情況..可以嘗試使用 OleDbConnection
或者你可以嘗試以下的CODE
Dim objConn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & System.Environment.CurrentDirectory &"\AAA.accdb;Persist Security Info=False;")
objConn.Open()
Please correct me if my concept is wrong
Chi- 已标记为答案 Mike FengModerator 2011年5月21日 10:42
全部回复
-
你好
或者你以嘗試安裝以下元件 2007 Office System Driver: Data Connectivity Components
Please correct me if my concept is wrong
Chi -
装2003后就可以了.
Mike Feng [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
你好
你的OFFICE 是那一個版本的
E.G. OFFICE 2010/ OFFICE 2007
我之前也有差不多的情況..可以嘗試使用 OleDbConnection
或者你可以嘗試以下的CODE
Dim objConn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & System.Environment.CurrentDirectory &"\AAA.accdb;Persist Security Info=False;")
objConn.Open()
Please correct me if my concept is wrong
Chi- 已标记为答案 Mike FengModerator 2011年5月21日 10:42