Results 1 to 6 of 6

Thread: Can i get an Opinion here?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Posts
    89
    Hi i am opening up serveral recordsets on my page and I use these to populate drop down boxes. Now I want to close all the recordsets: I put them in the following location near the end of the page. I also close them out using this function:

    function closeRS(rs)
    RS.Close
    Set RS = Nothing
    end function



    </table>
    </body>
    <%
    'close it out
    closeRS(rst1)
    closeRS(rst2)
    closeRS(rst3)
    closeRS(rst4)
    closeRS(rst5)
    closeRS(dbConn)%>
    </html>

    Does anyone see anything wrong with this method?

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    looks alright to me scott

    u getting errors?

    dvst8
    Secret to long life:
    Keep breathing as long as possible.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Posts
    89
    Im not getting any errors, I just want to make sure that I am writing clean code...

  4. #4
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    cleaner than mine
    Secret to long life:
    Keep breathing as long as possible.

  5. #5
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Well, it looks OK but question why do you need so many recordsets open at once?

    If I'm doing several queries I close the record set and reuse the variable.

    I then set the recordset and connection to nothing at the end of the page.

    Mark
    -------------------

  6. #6
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    mark = cleanest of clean

    the way mark suggested is definitely the best way to go.
    Secret to long life:
    Keep breathing as long as possible.

Posting Permissions

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



Click Here to Expand Forum to Full Width