Hello All,
I'm getting a run-time error 3704 that states "Operation is not allowed when the object os closed." when I attempt to close a recordset using ADO (2.5 Library).
Here is my sample code:
*********************************************************
Dim cn As ADODB.Connection
Dim rsStatus As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=SQLOLEDB;Data Source=" & txtServer.Text & ";Initial Catalog=" & txtDatabase.Text & ";User Id=sa;Password=;"
Set rsStatus = New ADODB.Recordset
rsStatus.CursorLocation = adUseClient
rsStatus.LockType = adLockOptimistic
sSQL = "UPDATE " & table1 & " SET [Priority]= '4-None'"
sSQL = sSQL & " Where [OpeningDone] = 'True' and [Store #] = '" & sStore & "'"
rsStatus.Open sSQL, cn
rsStatus.Close <----- Generates a Run-Time error 3704
***********************************************************
Any suggests or comments would be appreciated.
Thanks,
Kent
I'm getting a run-time error 3704 that states "Operation is not allowed when the object os closed." when I attempt to close a recordset using ADO (2.5 Library).
Here is my sample code:
*********************************************************
Dim cn As ADODB.Connection
Dim rsStatus As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=SQLOLEDB;Data Source=" & txtServer.Text & ";Initial Catalog=" & txtDatabase.Text & ";User Id=sa;Password=;"
Set rsStatus = New ADODB.Recordset
rsStatus.CursorLocation = adUseClient
rsStatus.LockType = adLockOptimistic
sSQL = "UPDATE " & table1 & " SET [Priority]= '4-None'"
sSQL = sSQL & " Where [OpeningDone] = 'True' and [Store #] = '" & sStore & "'"
rsStatus.Open sSQL, cn
rsStatus.Close <----- Generates a Run-Time error 3704
***********************************************************
Any suggests or comments would be appreciated.
Thanks,
Kent