My question is; Every time I do a TMquery.Open or TMquery.ExecSql it trigger the BeforeConnect Event, witch means it was Disconnected.
Is that Right? is there any propertie to just connect one time and Keep Connected until I Disconnect?
Obs: I'm sorry if it is a dumb question.
Is there any propertie to keep always connected?
-
- Posts: 2
- Joined: Thu 09 May 2019 15:34
Re: Is there any propertie to keep always connected?
Yes, you are right.Diego_Foli wrote: ↑Tue 21 May 2019 14:36 My question is; Every time I do a TMquery.Open or TMquery.ExecSql it trigger the BeforeConnect Event, witch means it was Disconnected.
Is that Right?
To solve your task you can use the TMyConnection.Ping method. This method can be used in order for the server not to close a connection due to timeout connection activity. In this case, you can use TMyConnection.Ping as follows - call it from the timer and set the interval timer to a value less than wait_timeout of the server (so that the intervals between commands receiving by the server do not exceed wait_timeout).Diego_Foli wrote: ↑Tue 21 May 2019 14:36 is there any propertie to just connect one time and Keep Connected until I Disconnect?
Obs: I'm sorry if it is a dumb question.