Solved

Is there a timeout property for  TSQLConnection.Connected := true?

Posted on 2008-10-23
3
1,215 Views
Last Modified: 2012-01-12
In an app I use dbExpress and TSQLConnection to connect to a SQL Server database on a remote host.

To be able to handle possible network breaks I want to detect connection losses in the TSQLConnection-component. My app is polling the db at regular intervals and I use a try--except-construct to catch possible errors.

In a test I disconnected from the network before even starting the app.
After a long time in TSQLConnection.Connected := true I got an error like:
SQL Server Error: [DBNETLIB][ConnectionOpen (Connect()).]Either there isn't any SQL Server or access denied.
In the exception-code the app then calls a procedure ReConnectDb to keep trying to establish a connection.

Is there something like TSQLConnectionTimeOut that can speed up detection of connection loss or what can one do to handle situations like this?

The app is supposed to run at a Rescue-centre and it is a MUST to get immedate warning of problems like this

Regards
Staffan
0
Comment
Question by:staffanbergbom
  • 2
3 Comments
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 22787624
If I remember right it used to be 30 seconds.
0
 

Author Comment

by:staffanbergbom
ID: 22788439
But is there something you can do about to reduce that amount of time?
0
 
LVL 15

Accepted Solution

by:
mikelittlewood earned 250 total points
ID: 22804091
Well TADOConnection has a connectionTimeout property, dont know about TSQLConnection sorry :o(
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now