VBA连接Oracle DB

时间:2018-04-10 12:32:56

标签: database vba oracle

我在VBA(宏)中使用以下代码连接Oracle DB。 我收到错误

  

运行时错误'3706':   应用程序定义或对象定义的错误

请帮我做任何其他设置

Sub ConnectToOracle()

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim mtxData As Variant


Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset

cn.Open ( _
    "User ID=cadcaguser" & _
    ";Password=cadcaguser11" & _
    ";Data Source=macroToDB" & _
    ";Provider=OraOLEDB.Oracle")


'Clean upin the end

Set cn = Nothing
Set rs = Nothing

End Sub

0 个答案:

没有答案