468,134 Members | 1,281 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,134 developers. It's quick & easy.

response.redirect and recordset/connection object?

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

Nov 18 '05 #1
1 968
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

"nick" <nb***@removethis.hotmail.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
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")

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Sam | last post: by
1 post views Thread by Milan Todorovic | last post: by
7 posts views Thread by Joe Rigley | last post: by
10 posts views Thread by isaac2004 | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.