I am having trouble with connecting to an oracle DB. I have tried to follow several of the FAQs but have had no success.
Here is my code. What am I doing wrong? Thanks in advance.
Dim strCnn As String
Dim strSQL As String
Dim rsData As ADODB.Recordset
Dim cnnADODB As ADODB.Connection
Dim Acommand As New ADODB.Command
strCnn = "dsn=usertest;Driver={Microsoft ODBC for Oracle};Uid=cook;Pwd=barkm3;"
strSQL = "select * From drlhl_ex" ' where drlhl_ex_ref_no like '%MW%' order by drlhl_ex_ref_no asc
Set cnnADODB = New ADODB.Connection
cnnADODB.ConnectionString = strCnn
cnnADODB.Open strCnn
Acommand.ActiveConnection = cnnADODB
Acommand.CommandType = adCmdTable
Acommand.Execute
Set rsData = New ADODB.Recordset
rsData.Open strSQL, cnnADODB, adOpenDynamic, adLockOptimistic
MsgBox "done " & rsData.RecordCount
************
My purpose in life is to show others what not to do.
<!--Caution, dates on calendar are closer then they appear.-->
Here is my code. What am I doing wrong? Thanks in advance.
Dim strCnn As String
Dim strSQL As String
Dim rsData As ADODB.Recordset
Dim cnnADODB As ADODB.Connection
Dim Acommand As New ADODB.Command
strCnn = "dsn=usertest;Driver={Microsoft ODBC for Oracle};Uid=cook;Pwd=barkm3;"
strSQL = "select * From drlhl_ex" ' where drlhl_ex_ref_no like '%MW%' order by drlhl_ex_ref_no asc
Set cnnADODB = New ADODB.Connection
cnnADODB.ConnectionString = strCnn
cnnADODB.Open strCnn
Acommand.ActiveConnection = cnnADODB
Acommand.CommandType = adCmdTable
Acommand.Execute
Set rsData = New ADODB.Recordset
rsData.Open strSQL, cnnADODB, adOpenDynamic, adLockOptimistic
MsgBox "done " & rsData.RecordCount
************
My purpose in life is to show others what not to do.
<!--Caution, dates on calendar are closer then they appear.-->