CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2001
    Location
    Los Angeles, CA, United States
    Posts
    47

    Closing RecordSet

    Do I close RecordSet Object(rs.close) when close connection(cn.close) at a time?
    Currently, in my program, there are no problem even if don't close recordset.
    If don't close recordset, does it occupy memory?
    Could anyone who know it let me know?
    Thank you.

    I'm a senior programmer.
    Working at CamSight, Dental imaging solutions industry.

  2. #2
    Join Date
    Jul 2000
    Posts
    124

    Re: Closing RecordSet

    Recordsets continue to take up memory until you close them and set them to nothing.

    rs.close
    set rs = nothing

    You can close them at any time it does not have to be when you close your connection to the database. I recommend that when you're finished using the recordset that you close it.

    HTH,
    Erica


  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Closing RecordSet

    A recordset stays in memory until it goes out of scope, then it is set to Nothing automatically. The recordset also remains open when you close the connection, but only if you have set the activeconnection property of the recordset to nothing.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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

Featured