response.redirect and recordset/connection object?

  • Thread starter Thread starter nick
  • Start date Start date
N

nick

I have the following code in JScript. Should I close and release the
database objects
before run response.redirect("some url")? or will the response.redirect
automatically close the database object/connection like the end of asp
script?

.......
var cmd = Server.CreateObject("ADODB.Command")
var rs = Server.CreateObject("ADODB.Recordset")
cmd.ActiveConnection = conn
cmd.CommandText = strCmd
cmd.CommandType = adCmdStoredProc
rs.Open(cmd)

.......

response.redirect("some url")
 
Nick,
Yes, you should close out all objects when you don't need them anymore.
Don't expect or even wait for something else to clean up your variables.
Being proactive will make it a better application. By the way, this is an
ASP.NET newsgroup, not an ASP 3.0 newsgroup.

Best regards,
Jeffrey Palermo
 
Back
Top