|
-
Jan 31st, 2000, 08:48 AM
#1
Thread Starter
Hyperactive Member
How can I detect if a recordset is still open? Because in the Form_unload event I have it close all the recordsets, however if the recordset isn't open, then I get an error, so I want to check if it is open first. How can I do this? Thanks
------------------
Ryan
-
Jan 31st, 2000, 08:53 AM
#2
If you use ADO, then it is very easy:
Code:
If rs.State = adStateClosed Then
MsgBox "Recordset is closed."
Elseif rs.State = adStateOpen Then
MsgBox "Recordset is opened."
End If
------------------
Serge
Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
-
Mar 15th, 2000, 04:54 PM
#3
Addicted Member
a recordset is Nothing when not open, so it's fairly simple (assume rstTmp is the recordset):
Code:
If rstTmp Is Nothing Then
'do nothing
Else
'do something
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|