Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2018-05-15 Thread Luca Olivetti via Lazarus
El 15/05/18 a les 21:11, Michael Van Canneyt via Lazarus ha escrit: I will need to check this, but the purpose of Close(True) is exactly to ignore errors while closing for a reconnect. It was introduced and tested in the case of MySQL, but normally should work on any database. Can you please

Re: [Lazarus] LazReport - Build variable or field names in script

2018-05-15 Thread Jesus Reyes A. via Lazarus
En Tue, 15 May 2018 10:58:57 -0500, Gabor Boros via Lazarus escribió: Hi All, I can build variable TEXT := '[PAGE_LNG_' + [LNG_ID] + ']: [PAGE#]'; and field TEXT := '[BDS.PAGE_LNG_' + [LNG_ID] + ']: [PAGE#]'; names in this way. LNG_ID is a report variable with a numeric value and the sh

Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2018-05-15 Thread Michael Van Canneyt via Lazarus
On Tue, 15 May 2018, Luca Olivetti wrote: El 15/05/18 a les 20:44, Michael Van Canneyt ha escrit: Is there a way to force the closing of a connection in this case so I can try and reopen it again? Try using forcedclose in SQLDb: TheDatabase.Close(True); Project project1 raised excepti

Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2018-05-15 Thread Luca Olivetti via Lazarus
El 15/05/18 a les 20:44, Michael Van Canneyt ha escrit: Is there a way to force the closing of a connection in this case so I can try and reopen it again? Try using forcedclose in SQLDb: TheDatabase.Close(True); Project project1 raised exception class 'EPQDatabaseError' with message: PQCo

Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2018-05-15 Thread Michael Van Canneyt via Lazarus
On Tue, 15 May 2018, Luca Olivetti via Lazarus wrote: Hello, I'm trying to devise a strategy for when the connection to the server fails. I'm using zeos but I also tried with sqldb and I couldn't find a way. I open a connection to the server, then I stop the server and subsequent operations

[Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2018-05-15 Thread Luca Olivetti via Lazarus
Hello, I'm trying to devise a strategy for when the connection to the server fails. I'm using zeos but I also tried with sqldb and I couldn't find a way. I open a connection to the server, then I stop the server and subsequent operations (e.g. refreshing a query) fail (obviously since the conne

[Lazarus] LazReport - Build variable or field names in script

2018-05-15 Thread Gabor Boros via Lazarus
Hi All, I can build variable TEXT := '[PAGE_LNG_' + [LNG_ID] + ']: [PAGE#]'; and field TEXT := '[BDS.PAGE_LNG_' + [LNG_ID] + ']: [PAGE#]'; names in this way. LNG_ID is a report variable with a numeric value and the showed captions or used field names depends on it. I try to eliminate the if