response.redirect and recordset/connection object?

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")
 
J

Jeffrey Palermo [MCP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top