Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to connect oracle DB using VBA and prompted with error:-Oracle client and networking componen

3010873Aug 24 2015 — edited Aug 24 2015

Hi,

It would be helpful to me if anybody can give me the instructions on setting up the oracle driver or client version required to connect to the the Oracle DB using excel VBA

My config:-

Windows - 8 - 64bit

excel 2013 - 32bit

Which client/components i should install and how to resolve below issue..

Tried VBA code.. but prompted with above error message

Sub Oracle()

    Dim con As ADODB.Connection

    Dim rs As ADODB.Recordset

    Dim query As String

    Set con = New ADODB.Connection

    Set rs = New ADODB.Recordset

    strcon = "Driver={Microsoft ODBC for Oracle}; " & _

    "CONNECTSTRING=(DESCRIPTION=" & _

    "(ADDRESS=(PROTOCOL=TCP)" & _

    "(HOST=HostNumber)(PORT=PortNumber))" & _

    "(CONNECT_DATA=(SID=SIDNumber))); uid=UserId; pwd=Password;"

    con.Open (strcon)

    If err.Number <> 0 Then

   MsgBox ("Oracle Error: " & vbCrLf & err.Description)

Else

   MsgBox ("Oracle DB Connection Successful.")

End If

End Sub

I will replace with original values in host..

This post has been answered by 3010873 on Aug 24 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2015
Added on Aug 24 2015
10 comments
6,577 views