M
MDW
Theoretical question.
If I create an recordset using the ubiquitous
Set objRS = objConn.Execute(strSQL)
I'm told that at the end of my code, I should set objRS
back to nothing to release the resources it uses. That's
all fine and good. My question is, if I create several
different recordsets throughout the course of the ASP
page, and (because I'm lazy) I want to re-use the name
objRS....should I set it to nothing before I re-create it
using a SQL statement? In other words, is there any
appreciable performance/resource difference between these
two scenarios?
' SCENARIO 1
Set objRS = objConn.Execute(strSQL)
....
Set objRS = objConn.Execute(strSQL2)
....
Set objRS = objConn.Execute(strSQL3)
....
Set objRS = objConn.Execute(strSQL4)
....
Set objRS = Nothing
' SCENARIO 2
Set objRS = objConn.Execute(strSQL)
....
Set objRS = Nothing
Set objRS = objConn.Execute(strSQL2)
....
Set objRS = Nothing
Set objRS = objConn.Execute(strSQL3)
....
Set objRS = Nothing
Set objRS = objConn.Execute(strSQL4)
....
Set objRS = Nothing
If I create an recordset using the ubiquitous
Set objRS = objConn.Execute(strSQL)
I'm told that at the end of my code, I should set objRS
back to nothing to release the resources it uses. That's
all fine and good. My question is, if I create several
different recordsets throughout the course of the ASP
page, and (because I'm lazy) I want to re-use the name
objRS....should I set it to nothing before I re-create it
using a SQL statement? In other words, is there any
appreciable performance/resource difference between these
two scenarios?
' SCENARIO 1
Set objRS = objConn.Execute(strSQL)
....
Set objRS = objConn.Execute(strSQL2)
....
Set objRS = objConn.Execute(strSQL3)
....
Set objRS = objConn.Execute(strSQL4)
....
Set objRS = Nothing
' SCENARIO 2
Set objRS = objConn.Execute(strSQL)
....
Set objRS = Nothing
Set objRS = objConn.Execute(strSQL2)
....
Set objRS = Nothing
Set objRS = objConn.Execute(strSQL3)
....
Set objRS = Nothing
Set objRS = objConn.Execute(strSQL4)
....
Set objRS = Nothing