Re: Connected := False {does not close the connection}
From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 10/20/04
- Next message: Hans: "Re: Reading large Foxpro tables( with ODBC?)????"
- Previous message: Brian Bushay TeamB: "Re: Still having a problem with MS SQL and NT Service"
- In reply to: Richard Milewski: "Connected := False {does not close the connection}"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Hans: "Re: Reading large Foxpro tables( with ODBC?)????"
- Previous message: Brian Bushay TeamB: "Re: Still having a problem with MS SQL and NT Service"
- In reply to: Richard Milewski: "Connected := False {does not close the connection}"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|