Close and free up object references

Posted: August 8, 2008 in ASP

While we’re on the topic of good coding techniques, I thought I would remind everyone to close and free up object references once they are done using them.

I tend to type in the commands to kill the object right after I create the object, and then start coding between them.

Dim objConn, objRS
Set objConn = Server.CreateObject(“ADODB.Connection”)
objConn.ConnectionString = …

Set objRS = objConn.Execute(“…”)

Set objRS = Nothing

Set objConn = Nothing


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s