PDA

Click to See Complete Forum and Search --> : determine recordset closed?


kovan
Aug 24th, 2000, 07:18 AM
how does one determine if a recordset is opened or closed?
i tried

if rs.open then
msgbox "Record is open
else
msgbox "Record is closed"
end if


it didn't work, and i didn't expect it to work
but i thought i would give it a shot before posting a message on it
thanks

kovan
Aug 24th, 2000, 07:19 AM
just answered my own question
if anyone wants to knw how

you check for if RS.State = adStateOpen

Gary.Lowe
Aug 24th, 2000, 07:30 AM
Here is another way Kovan



'Good for closing recordset's, connection, workspaces
If Not rs Is Nothing Then
rs.Close
Set rs = Nothing
End If

'Something similar to yours.

If Not rs Is Nothing Then
msgbox = "Recordset is open"
else
msgbox ="Recordset is closed"
End If


I had some problems that if the recordset was closed the adStateOpen returned an error. Not sure if it was my programming though.