【问题标题】:Excel VBA 2007 connection to access 2010 accdb, run-time error "Unrecognized database format"Excel VBA 2007 连接访问 2010 accdb,运行时错误“无法识别的数据库格式”
【发布时间】:2016-08-24 18:32:48
【问题描述】:

在为运行 Excel 2007 的同事部署小型 Excel VBA 代码以访问 .accdb 2010 数据库时。我收到以下错误

运行时错误'-2147467259 (80004005)':

无法识别的数据库格式“\dbname.accdb”

我非常卡在这个错误上,因为它在 Excel 2010 中有效,但在 Excel 2007 中无效?我的数据库连接代码如下:

' Declarations
Dim conn As Object
Dim rs As Object
Dim strConnect As String
Dim strng As String

' Open Database
Set conn = CreateObject("ADODB.Connection")
' Define the connection String
strConnect = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
                "Data Source=" & _
                Glo_Database_Path & ";"
' Open Connection
conn.Open strConnect

任何想法如何从 Excel 2007 64 位连接到 accdb 2010?

【问题讨论】:

  • 你考虑过DAO吗?它更快。 stackoverflow.com/questions/30973591/…
  • 还没有...但我不会通过 cn.Open strCon 调用
  • 我不擅长这种问题,但是您是否尝试使用宏录制来记录在 excel 2007 中建立与 access 2010 db 的连接?我只是希望它能带来一些启示。

标签: vba excel ms-access


【解决方案1】:

我相信 Excel 2007 不支持 accdb 2010(但 Excel 2010 支持)

将 accdb 2010 保存为 mdb 格式并尝试连接。

【讨论】:

  • 嗯...我希望不是这样
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-13
  • 1970-01-01
  • 2012-05-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多