closing recordset objects

Results 1 to 3 of 3

Thread: closing recordset objects

  1. #1
    Join Date
    Dec 1969

    Default closing recordset objects

    If I do this<BR><BR>response.redirect "somewhere.asp"<BR>rs.close<BR>set rs = nothing<BR>myConn.close<BR>set myConn = nothing<BR><BR>will my connections still get closed even though I redirected first?<BR><BR><BR>Paul<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: closing recordset objects

    No.<BR><BR>Try and see if this works!<BR><BR>Response.Redirect "default.asp"<BR>Response.Write "Wait before going I need to tell you ..."<BR><BR>You&#039;ll never see the message cauze it just won&#039;t go there.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Yes, but not becuz of your code...

    The objects are closed and the memory garbage collected because the ASP engine and the scripting engines cooperate: ASP tells VBS to "shut down", so VBS goes and finds all "live" references to COM objects and closes them and does a COM ".Release" call on them.<BR><BR>Which means you actually *never* have to close objects or set the references to nothing...but doing so aids the performance measurably so it&#039;s still a good idea.<BR><BR>The "myth" about memory leaks from non-closed connections is just that: A myth. Oh, it *WAS* true back in ASP 1.0 days, but that was because of bugs in the code, not because of flaws in the principal design.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts