Which is the better way?

Results 1 to 3 of 3

Thread: Which is the better way?

  1. #1
    Join Date
    Dec 1969
    Posts
    58

    Default Which is the better way?

    &nbsp;<BR>I have a code which looks like :<BR> &#060;%<BR> Set objConn = CreateObject("ADODB.Connection") <BR> objConn.Open strDSN<BR><BR> Set objRS = objConn.Execute(" ....<BR> .<BR> .<BR> .<BR><BR> objConn.Close<BR> Set objConn = Nothing<BR> %<BR><BR><BR>So my question is : Is it necessary to explicitly close and then destroy<BR>the recordset object as follows ?<BR><BR> &#060;%<BR> objRS.Close<BR> Set objRS = Nothing<BR> %<BR><BR>I&#039ve read somewhere that if recordset is using some connection object, then after<BR>closing and destroying the connection will release recordset object automatically. I am not sure about what I have read ....So I want to know if it is true?<BR><BR>Thank u all<BR>☺NRK

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Which is the better way?

    It&#039s always a good idea to explicitly close and destroy all objects! Each object is suppose to free its own memory when the ASP page finishes executing, but it&#039s always safest just do explicitly do it each time! Hope this helps. Does it answer your question?

  3. #3
    Join Date
    Dec 1969
    Posts
    58

    Default RE: Which is the better way?

    yupp..<BR> thanks a lot<BR>~NRK

Posting Permissions

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