Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to Oracle DB through ODBC using ADO

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I am using VB 6.0 SP 5 and Oracle 8i on windows 2000 server. I want to connect to Oracle Database through ODBC using ADO. Any help in this.
 
Here is a snippet that I use.

Public cnnADO As ADODB.Connection

Public Sub bOpenADOConnection(bADOcnnOpened As Boolean, sPassword as string, sUserID as string, sDSN as string)
On Error GoTo err_Proc
Dim sCnnADO As String
'establish connection to oracle
sCnnADO = "Provider=MSDASQL.1;Password=" & sPassword & ";Persist Security Info=True;User ID=" & sUserID & ";Data Source=" & sDSN
With cnnADO
.CursorLocation = adUseClient
.ConnectionString = sCnnADO
End With
cnnADO.Open
bADOcnnOpened = True
exit_Proc:
Exit Sub
err_Proc:
'create error handling routine
bADOcnnOpened = False
Resume exit_Proc
End Sub
 
Don't. use the Oracle 8.1.7 OLEDB provider: it's much faster and more powerful.
Try the following connection string:"Provider=OraOLEDB.Oracle.1;Password=%P%;User ID=%U%;Data Source=%D%;PLSQLRSet=1;ChunkSize=32676;FetchSize=20"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top