Jumat, 27 April 2012

[ExcelVBA] Connect to Oracle using ADO with Run-time error '-2147467259 (80004005)'

 

Hi,

I am trying to extract data from Oracle using ADODB conneciton.
Here is my connection string:

oraConStr = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=" & oraHost & ")(PORT=1521))" & _
"(CONNECT_DATA=(SERVICE_NAME=" & DBStr & "))); uid=" & User & " ;pwd=" & pwd & ";"
Set oraConnect= CreateObject("ADODB.Connection")
Set oraResult = CreateObject("ADODB.Recordset")
oraConnect.Open oraConStr
Set OraResult= OraConnect.Execute(mySql)

When I run the marco, I got the run-time error '-2147467259 (80004005)'[Microsoft][ODBC driver for Oracle][Oracle].

Could you please help me to tell me what is wrong.

Many Many Thanks

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar