I spent whole day trying to figure out this error. "Operation is not Allowed when the object is closed" and came with no answer. What I am simply trying to do is set a cursor for this particular record set. I know the code below works with simple SQL statement but as soon as I put in very long query in the strSQL variable. The below fails at the last line. I know that the "long query" is valid because it runs fine with Toad. If you someone could tell me what are the possible causes, it will help me greatly. I am so frustrated so any suggestion will be very much appreciated.
Thank you very much
Sam
Dim strConn, sSQL As String
Dim rs As ADODB.Recordset
Dim strDB, strUser, strPass As String
strDB = "XXX"
strUser = "YYY"
strPass = "ZZZ"
strConn = "Provider=MSDAORA;Data Source=" + strDB + " ;user ID=" + strUser + ";password=" + strPass
Set rs = New ADODB.Recordset
rs.Open strSQL, strConn, adOpenForwardOnly
Thank you very much
Sam
Dim strConn, sSQL As String
Dim rs As ADODB.Recordset
Dim strDB, strUser, strPass As String
strDB = "XXX"
strUser = "YYY"
strPass = "ZZZ"
strConn = "Provider=MSDAORA;Data Source=" + strDB + " ;user ID=" + strUser + ";password=" + strPass
Set rs = New ADODB.Recordset
rs.Open strSQL, strConn, adOpenForwardOnly