Connect To Oracle Database From Excel VBA

Connect To Oracle Database From Excel VBA

Had similar problem, but after long research I was able to resolve it with such connection string:

    Dim Cn As New ADODB.Connection
    With Cn
        .ConnectionString = Driver={Oracle in instantclient_21_3}; & _
                            DBQ=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=<service_name>)));UID=<user_name>; PWD=<password>;

        Call .Open
    End With

Please, change <…> values accordingly.

Connect To Oracle Database From Excel VBA

Leave a Reply

Your email address will not be published. Required fields are marked *