Greetings,

I have the following code:

function TQueryThread.ConnectionActive : boolean;
begin
result := False;
with FQuery.AdsConnection do begin
if IsConnected then begin
if IsConnectionAlive then
result := True;
end else begin
try
Connect;
result := True
except
on E: EAdsDatabaseError do begin
if (E.ACEErrorCode = 6610) or (E.ACEErrorCode = 6313) then
FResult := qrNoConnection;
end;
end;
end;
end;
end;

This works fine except that, as the technical documentation states, the
timeout for the exception varies depending on the processor speed. The
default is anywhere between 20 and 90 seconds. If I lower the default it
will be too short in some cases.

If I run my own timer, is there a way that I can abort the connection
attempt? What if I literally free (destroy) the query instance?

This application is going to be used in the field and I expect that
access will be spotty. I want the user to receive a message after a very
specific amount of time, no more than 20 seconds. Otherwise, the user is
not going to know what is going on.

Michael Philbrick