问候..
我对 Oracle 很陌生,但对 Sql 有一定的了解。
我正在尝试从 VBA 连接外部 Oracle DB - 下面的 Excel 是代码..
Function ORAQUERY(strHost As String, strDatabase As String, strSQL As String,
strUser As String, strPassword As String)
Dim strConOracle, oConOracle, oRsOracle
Dim StrResult As String
StrResult = ""
strConOracle = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=207.169.236.29)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DEDWRP01.DE.EDS.COM))); uid=" & strUser & " ;pwd=" & strPassword & ";"
Set oConOracle = CreateObject("ADODB.Connection")
Set oRsOracle = CreateObject("ADODB.Recordset")
oConOracle.Open strConOracle
End Function
在尝试运行上面的代码时,我遇到了错误..
[Microsoft][Oracle 的 ODBC 驱动程序][Oracle]ORA-12154:TNS:无法解析指定的连接标识符
我已经安装了 oracle 10g,我可以通过Oracle SQL* Plus连接数据库。
请帮助我。谢谢提前帮助..