Solved

What is the importance of closing a record set and connection upon completing a set of commands in asp?

Posted on 2004-04-19
2
191 Views
Last Modified: 2010-05-18
Hi Experts,

Is it necessary to do the following after a set of commands has been read?


rs.Close
set rs=nothing


conn.close
set conn=nothing
0
Comment
Question by:indyng
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 125 total points
ID: 10858937
Hi indyng,

Yes!

If you do not close these objects and set them to nothing there is no guarantee that the resources used by the objects will be released properly when they are implicitly closed.

As with all objects, you should ensure that you manage the whole lifecycle of the object, if you create it and instantiate it then you should close it and release it when you are finished with it. Now of course that period of time is variable and depends entirely on your situation. Either way it is a good rule of thumb that you should close and release everything you open.

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 
LVL 1

Author Comment

by:indyng
ID: 10858973
Thanks Tim
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Out the count variables 6 54
Issue with Loop 4 58
Update function to validate checkbox is checked 4 76
One field not displaying content (ASP Classic) 8 26
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question