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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now