Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TADOConnection vs KeepConnection

Status
Not open for further replies.

rcloutie

Programmer
May 26, 2005
164
CA
Hi there,

I'm using Delphi 2007 via ADO objects to establish a connection to SQL Server 2005 databases.

Since few months, we have some problems with our advantage database server (need to be rebooted every 2 weeks or so), which is accessed from a linked server of SQL Server 2005. We think that maybe there's a property which cause connections to the linked server (ADS) to be duplicated.
Actually, there's only one connection (defined in a datamodule) and all queries are using the same connection.

I considered that using KeepConnection active kept closing connection ignored (from ADODB.TAdoConnection object). Am I right?
1. Using KeepConnection=True ignores all connection.close statement?
2. Using KeepConnection=False disconnects almost every time a query is initialized (that is, setting the connection property, flag IsConnected=True; but when setting SQL string, flag IsConnected=False?);

I prefer to use default settings (KeepConnection=True) since it makes faster apps and less network traffic. But the trailing connections lost is a bad side effect that I need to solve. Is it possible that KeepConnection works well on a SQL Server database but for a linked server, there's always new (duplicated) connection each time a query is launched?

Thanks in advance,

Rej Cloutier

PS Sorry for crossposts : CodeGear (Borland) Delphi Forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top