Reputation: 67
So far I have the following code
Dim strConnect
Dim adoConnection
Dim adoRecordset
Dim strSQL
Dim strResults
strSQL = "SELECT COUNT(distinct party_id) FROM apps.per_all_people_f"
strConnect = "Provider=OraOLEDB.Oracle.1; Password=pwd; Persist Security Info=True; User ID=user; Data Source=source; Extended Properties="""
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Open strConnect
Set adoRecordset = CreateObject("ADODB.Recordset")
adoRecordset.ActiveConnection = adoConnection
adoRecordset.Source = strSQL
adoRecordset.Open
Do Until adoRecordset.EOF
strResults = adoRecordset.Fields(0).Value
msgbox strResults
adoRecordset.MoveNext
Loop
adoRecordset.Close
adoConnection.Close
Help me on correcting above code where I need to connect to Oracle DB and process some steps based on out data.
Im getting following error message.
Arguments are of the wrong type, are out of acceptable range, or are in conflict with another. Line 9 Source: ADODB.Connection
Upvotes: 2
Views: 30092
Reputation: 136
This is for your information, please correct me if I am wrong:
Ways of connecting to DB:
Hope this helps. Correct me guys if I am wrong anywhere, as I am still learning.
Upvotes: 0