majjam
majjam

Reputation: 1326

Connecting to Oracle using ADO

I have been given some vba code to support that connects to an Oracle database using the following syntax:

Dim m_dbConn As New ADODB.Connection
With m_dbConn
        .ConnectionString = "DRIVER={Oracle in oraI3CL_32};dbq=DWGBP1;Uid=;Pwd=;"
        .Properties("Prompt") = adPromptAlways
        .CursorLocation = adUseServer
        .Mode = adModeRead
        .IsolationLevel = adXactIsolated
        .CommandTimeout = 120
        .Open
End With

Normally we would use ODP.net to connect so this syntax is unfamilar to me, and any googling of oraI3CL_32 returns no results. Please can someone explain what oraI3CL_32 is, what the syntax "Oracle in oraI3CL_32" means, and whether the above relies upon having the Oracle Data Provider / tnsnames.ora preinstalled on the system? Any clarification of the difference between using ADO and ODP.net to connect (and where EZConnect fits in all this) would also be greatly appreciated.

Upvotes: 0

Views: 1076

Answers (1)

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59642

You connection string looks more like an ODBC connection.

In order to use a ADODB.Connection your connection string should look like this one: Provider=OraOLEDB.Oracle;Data Source=DWGBP1;User Id=myUsername;Password=myPassword

See other examples here: OLE DB Provider

or here Oracle connection strings

Upvotes: 1

Related Questions