closing database connection

Results 1 to 2 of 2

Thread: closing database connection

  1. #1
    Join Date
    Dec 1969

    Default closing database connection

    Hi,<BR><BR>I was wondering why my database connection is not successfully closing. here is my code in JavaScript:<BR> <BR>var DBConn = Server.CreateObject("ADODB.Connection");<BR>DBConn .ConnectionTimeout = 15;<BR>DBConn.CommandTimeout = 30;<BR>DBConn.CursorLocation = 3;<BR>DBConn.Open(connectionstring, username, password);<BR>DBConn.Open();<BR>DBConn.Close();<BR >DBConn = null;<BR><BR>I use MSSQL and ran the performance monitor, checking the active connections. When the page loads, a new connections logs, however, it does not close (not even when I close the browser window). It times out some 1 - 2 minutes after it was created.<BR><BR>Is this normal, is there something wrong with my code?<BR><BR>Thanks for any help,<BR>Cornelius

  2. #2
    Join Date
    Dec 1969

    Default RE: closing database connection

    they don&#039;t close immediately. It&#039;s a consequence of connection pooling, which is enabled in ADO. they stick around for a little while in order to be re-used if needed. you code looks fine to me<BR><BR><BR>j<BR>

Posting Permissions

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