Image

Imagevalera wrote in Imagewebdev

Closing ASP ADODB Connections

How important is it to close the ADODB connections and to set them to Nothing?

If I have an open connection, and in numerous options after doing something with the DB, my script redirects the visitor to a different page, should I make sure to close&Nothing the connection in all of the instances where the script doesn't reach the end of itself (where the close&Nothing commands are)?

e.g.:
Set DB = Server.CreateObject("ADODB.Connection")
DB.Open connstr
If something Then
redirect

ElseIf somethingelse Then
redirect

End If

DB.Close
Set DB = Nothing