Get Fresh Tips Every Week!
Don't Miss Any Web Development Tips. Subscribe to the Web Development Tip Newsletter.

View Archive

Bookmark This Site
Keep up with our Tips


Tip of the Day RSS Feed
Fresh Web Development Tips Daily


Business Solutions
Our tips are powerful.
Our writers are experts.
Our results are guaranteed.

 

Listen to our Radio Show
Hot topics for both consumers
and webmarketers
on WebmasterRadio.FM

Every Wednesday, 4PM Eastern.

 

Close those objects!

When you instantiate an obbect, such as a connection, recordset, filesystemobject, etc., remember to .close them, and to also set them to "nothing". Each time an object is created, memory is used up. Yes, when you exit a function the object instantiated within them go out of scope and supposedly are close, but it's a good programming practice to close and free up anyway.
For example:
dim rs
set rs = getUsersRS()
if not rs.eof then
do while not rs.eof

'do something here
rs.movenext
loop
end if
rs.close
if not rs is nothing then set rs = nothing

this effectively kills off the recordset object rs.
6.4 6.4
Save Tip Tip Rating

Comments

Nobody has commented on this tip yet. Be the first.

Name:


Comment:




Learn more about our Exclusive Program we offer our clients.