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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scope of public proc recordset in VBA? 2

Status
Not open for further replies.

steve728

Programmer
Mar 16, 2003
536
US
When closing a public procedure that has its own dimmed rs and rs.open recordset, is there an absolute need to rs.close it? I know it's just a good idea for a cleanup process at the end of the procedure but, doesn't it automatically get closed anyway? I will continue to use the .close. I've come across a lot of someone elses code that does not do it. We're talking MS Access 2000 here.

Thks in advance.

Steve728
 
doesn't it automatically get closed anyway
It should, but access is known to sometimes forget the cleanup stuff ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Closing & setting = Nothing guarantees that there are no interface pointers left hanging.

Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.
 
personally I usually never close the rs unless I'm going to be using it later on in the same sub, and I've not encountered any problems...

but I only do that cos I'm lazy...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top