• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Unable to connect to oracle data base through Excel2013 Macro

U haven't specified HOST & PORT.

Code:
Sub Connection()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
strcon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=HostName)(PORT=PortNumber))" & _
"(CONNECT_DATA=(SID=SID))); uid=user; pwd=pwd;"
con.Open (strcon)
If err.Number <> 0 Then
MsgBox ("Oracle Error: " & vbCrLf & err.Description)
Else
MsgBox ("Oracle DB Connection Successful.")
End If
End Sub

http://www.learnexcelmacro.com/wp/2011/11/oracle-connection-string-in-vba/

Also check this..

https://community.oracle.com/thread/1083666
 
with code, i do not have any problem because the same code was working earlier..(host..etc i ll replace)
i have formatted my pc and lost all configuration...
and i re-install oracle client and components .and now am getting this error which am not aware..
 
Back
Top