Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
proper way to parse url in delphi 2 163
delphi prevent click fast 2 191
Create a path if not exists 7 69
TEMBEDDEDWB how can i change its user agent ? 8 49
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 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

15 Experts available now in Live!

Get 1:1 Help Now