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
192 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

860 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