connection timeout

connection timeout

Post by Yahyae » Wed, 21 Jul 2004 12:12:34


Hi
How can i set connection timeout in TDataBase?
Using d6, TDatabase, MSSQL driver
I have two w2k servers running sql2k (f1, f2). I want to write a
procedure that checks if f1 is up and its sql server is running, if not,
then connects to f2.

db1.params.values['SERVER NAME'] := 'f1';
try
db1.connected := true;
except
db1.params.values['SERVER NAME'] := 'f2';
db1.connected := true;
end;

if f1 does not respond, procedure waits for 60 seconds (connection timeout).

Q1 - How can i reduce this timeout?
Q2 - Is there better way to do this?

I have tried ADO's connection timeout, but it didnt work.

Thank you for your guidance and suggestions.
 
 
 

connection timeout

Post by Yahyae » Thu, 22 Jul 2004 03:23:25

Hi,
I want to check (sql) server, not more. I dont want to execute any sql or DB
command.
while server is up, its connection time is < 1ms. i think a 3s connection
timeout is enough to check server.
I hope to find a solution with ADO or others.
regards