Setting Open Objects = Nothing

Results 1 to 3 of 3

Thread: Setting Open Objects = Nothing

  1. #1
    Join Date
    Dec 1969

    Default Setting Open Objects = Nothing

    Does anybody know how to test an object to see if it is currently open and/or set?<BR><BR>For example at the bottom of every .asp page, I&#039;d like to be able to use something like...<BR><BR>&#060;% If oRST.Open = True Then<BR> oRST.Close<BR> End If %&#062;<BR><BR>- or - <BR><BR>&#060;% If oRST &#060;&#062; Nothing Then<BR> Set oRST = Nothing<BR> End If %&#062;

  2. #2
    Join Date
    Dec 1969

    Default your bottom code id correct <eop>


  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default They are 2 DIFF things

    in the first one you are closing the object but NOT killing it as in not relasing the memory allocated to the object.<BR><BR>Though you have it a bit wrong<BR>If oRST.state = 1 then<BR>oRST.close<BR><BR><BR>the second one is where you are testing it the object has been created and if it has you are killing it.<BR><BR><BR><BR>Basically shecking if it is open and checkingif it is "set" are 2 diff things....what the code should be dependes on what you need to do.

Posting Permissions

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