Re: Connected := False {does not close the connection}

From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 10/20/04


Date: Tue, 19 Oct 2004 21:32:38 -0500


>I am using Delphi 7 and SQL Server 2000.
>
>I am running in a service and need to disconnect from the database when the
>process is idle.
>This is seen even at design time:
>Drop a TADOConnection and connect to the database.
>>From a separate connection, such as query analyzer, run 'master..sp_who2'.
>You will see the design-time connection in the list.
>Set the ADOConnection.Connected property to False.
>Re-run 'master..sp_who2'.
>You will notice that the connection still exists.
>The ADOConnection must be destroyed before the database no longer registers
>the connection.
>I assume I'm missing something, so any help will be greatly appreciated.

SQL server pools connections by default.
To turn off connection pooling add
OLE DB Services = -2; to your connection string

--
Brian Bushay (TeamB)
Bbushay@NMPLS.com


Relevant Pages

  • Re: ADO Connection Timeout
    ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... When the first test is run, the results are stored in the central database. ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... much rather write stored procedures and use server side cursors. ... local database, it is vital that I get the information to a central server. ... Once the connection is restored, ...
    (microsoft.public.data.ado)
  • Re: ESQL/C documentation nightmare
    ... documentation about explicit and implicit connections. ... CONNECTION connection statements for new applications of Version 6.0 ... the SQL database statements (such as ...
    (comp.databases.informix)