Closing connections to DB

Results 1 to 3 of 3

Thread: Closing connections to DB

  1. #1
    Join Date
    Dec 1969

    Default Closing connections to DB

    Why do you need to close connection to db? should you use <BR><BR>set connection = nothing<BR>and<BR>connection.close <BR><BR>And do you do the sam for any recordsets that are being used?<BR><BR>Thanks

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

    Default RE: Closing connections to DB

    Well you dont NEED to but it is a good practise to. <BR><BR>Basically the ideal way would be to open it JUST before you need it and clost just after you finish with it. A lot of people open it at the top of the page and close it at the bottom of the page which is something one cant cry murder about not the BETS way.<BR><BR>When you set a referance to an object connection or recordset some memory is allocated to it and obviously the system resources are limited. So what will happen if you have about 10000 users accessing your site each have connection and recordset objects open. This "COULD" slow down the server because of the "limited" memory why not just free it up as soon as possible<BR><BR>Always close the object AND set it to nothing<BR><BR>EAT it <BR>SLEEP it<BR>BREATH it<BR>WORSHIP it<BR>LIVE it

  3. #3
    MG Guest

    Default Just do it

    I am not going to go into every reason that your connection should be closed except to say that you will probably have problems and experience slower performance if you do not.<BR><BR>when you finish using a recorset where rs is the recordset<BR><BR>rs.close<BR>set rs=nothing<BR><BR>when you finish using the connection where conn is the connection <BR><BR>conn.close<BR>set conn=nothing

Posting Permissions

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