Solved

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

Posted on 2008-10-23
3
1,276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why can't I create any project with my delphi EXE file? 6 45
Delphi Yen format 3 62
How to build JSON File in Delphi 6 3 71
Get weeknumber and year from date 4 31
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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