Dave Murray wrote:
> Hi,
> 
> I've got a D2006 app that is connecting to MS SQL Server 2005 Express
> Edition (I think, the server is in Holland and I'm in Scotland) via
> ADO. If the user leaves the app idle for a long period of time (how
> long is unknown atm) and then starts working again they get
> 'connection lost' messages from the ADO components. The only way to
> get the connection back is to reboot the app, which closes and reopens
> the TADOConnection.
> 
> Is there any way to make TADOConnection or the SQL Server keep the
> connection alive? Or to increase the time limit before it is closed?
> 
> If not, how do I detect the lost connection and reconnect automatically?
> 
> Thanks,
> Dave.
> 
> Dave Murray
> Glasgow, UK

The simplest way is probably to set up a timer in the app. that runs a 
SQL SELECT query with 0 results (an empty table could be used).  SQL 
Server connections are over TCP/IP and the connection failure is 
typically at the TCP level.  TCP can be kept alive by simply sending 
data over the connection every 30-60 seconds.

--
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

Safe C++ Design Principles (First Edition)
Learn how to write memory leak-free, secure,
stable, portable, and user-friendly software.

Learn more and view a sample chapter:
http://www.CubicleSoft.com/SafeCPPDesign/



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/TktRrD/gOaOAA/yQLSAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/delphi-en/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to