Open connections to database crash server

Results 1 to 2 of 2

Thread: Open connections to database crash server

  1. #1
    Join Date
    Dec 1969

    Default Open connections to database crash server

    Hi, I&#039m having the following problem:<BR><BR>On my site I have about about 15 different ASP files which each open a connection to the same MS Access Database. After a connection is opened in a file from 1-5 queries are executed utilizing that connection. This seems to work fine generally.<BR><BR>However, about twice a day my site crashes my ISP&#039s server because there are hundreds of connections that were opened and never closed. I&#039ve looked through all my ASP code and can&#039t find a place where I neglect to close a connection. Is there something else I&#039m missing or that I should look for?<BR><BR>I&#039m using commands in the following format:<BR><BR>&#060;%<BR>Set MyConn = Server.CreateObject("ADODB.Connection")<BR> MyConn.Open "DSN=bug1"<BR> Set RS = MyConn.Execute(sqlQuery1)<BR> Set TS = MyConn.Execute(sqlQuery2)<BR>%&#062;<BR><BR>&#060; %<BR> WHILE NOT RS.EOF<BR>%&#062;<BR><BR>&#060;%<BR> RS.MoveNext<BR> WEND<BR> RS.Close<BR>%&#062;<BR><BR>&#060;%<BR> TS.Close<BR> MyConn.Close<BR> %&#062;

  2. #2
    Alfredo Fornaso Guest

    Default RE: Open connections to database crash server

    Try to set the objects to nothing after close it.<BR>here is your modified code.<BR>sorry my english ...<BR><BR>&#060;%<BR>RS.MoveNext<BR>WEND<BR>RS.Cl ose<BR>set RS=nothing<BR>%&#062;<BR><BR>&#060;%<BR>TS.Close<B R>set TS=nothing<BR>MyConn.Close<BR>set RS=nothing<BR>%&#062;

Posting Permissions

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