About TUniConnection ConnectionTimeout ?? WHY ??
Posted: Sat 04 Feb 2012 05:28
Hello, uses unidac(3.6) to access sql server 2005 (192.168.1.3), the following code:
If the server is using invalid host name, such as (localerr), prompt time-out in over 7000.
But if you are using an invalid ip address such as 192.168.1.44, timeout prompted more than 52000, why?
Long time-consuming, and can not accept, please help, thank you!
[/size]
Code: Select all
con.Close ;
con.SpecificOptions.Clear;
con.SpecificOptions.Values['ConnectionTimeout']:='5';//+2
st := GetTickCount;
con.ProviderName:='SQL Server';
con.Database:=jy_database.Text ; // 'jgxt';
con.Server:=jy_server_txt.Text ;
con.Username:=jy_user_txt.Text ;
con.Password:=jy_pass_txt.Text ;
try
con.open ;
st := GetTickCount - st;
except
st := GetTickCount - st;
end;
showmessage(inttostr(st)) ;But if you are using an invalid ip address such as 192.168.1.44, timeout prompted more than 52000, why?
Long time-consuming, and can not accept, please help, thank you!
[/size]