Solved

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

Posted on 2008-10-23
3
1,247 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

10 Experts available now in Live!

Get 1:1 Help Now