?
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
Medium Priority
?
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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 have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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/…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

771 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