我是 excel 2007 的初学者。我正在尝试连接到 oracle 数据库 10G 并从中提取数据。我收到 “运行时错误:'-2147467259(80004005)':自动化错误未指定错误”。此代码适用于我的前辈。请帮助!
Sub build_database_connection()
Dim cn As ADODB.Connection
Set cn= New ADODB.Connection
servername = example.com
UserName = example
pass = example
cn_cdcp.Open "Provider=MSDAORA.1;Data Source=" & servername & ";User ID=" & UserName & "Password=" & pass & ";"
End Sub