Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if recordset is open 1

Status
Not open for further replies.

jpgactmod

Technical User
Feb 12, 2004
41
US
One of my main source of errors is trying to open a recordset when it is already open or trying to close it when it is already closed. Is there an easy way to check if a record set is open?

Thanks much for any help.

Jim
 
If ADO, take a look at the State property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
If you're using ADO, try something like this:

[tt]if (not (rs is nothing)) then
' it is instantiated
if (rs.state=adstateopen) then
' it is open
end if
end if[/tt]

Roy-Vidar
 
Roy-Vidar,

Thank you very much for a great suggestion in a very understandable format.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top