Recent

Author Topic: How to set the connection timeout period?  (Read 1115 times)

zhuyl

  • New member
  • *
  • Posts: 6
How to set the connection timeout period?
« on: November 18, 2021, 10:13:10 am »
How to set the connection timeout period? The database is MSSQL.

Zvoni

  • Hero Member
  • *****
  • Posts: 842
Re: How to set the connection timeout period?
« Reply #1 on: November 18, 2021, 10:25:38 am »
At a guess: Use the Params-Property of TMSSQLConnection.
Something like (Aircode)
Code: [Select]
MyMSSQLConn:=TMSSQLConnection.Create;
//Set other Properties, Databasename, Host, Port etc.
MyMSSQLConn.Params.Add('Connect Timeout=30');
MyMSSQLConn.Open;
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

zhuyl

  • New member
  • *
  • Posts: 6
Re: How to set the connection timeout period?
« Reply #2 on: November 18, 2021, 10:37:43 am »
Thanks!
How to set the execution timeout of SQLQuery1?

Zvoni

  • Hero Member
  • *****
  • Posts: 842
Re: How to set the connection timeout period?
« Reply #3 on: November 18, 2021, 12:13:14 pm »
Thanks!
How to set the execution timeout of SQLQuery1?
You don't. AFAIK, it's a Server-Side Parameter which is valid for all queries.
In that vein: It's a connection Parameter (see above)
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018