Deal with bad connections
Posted: Mon 27 Apr 2015 08:31
Hello,
we use
dbxida42.exe filedate 7.6.12 with version dbexpida.dll ist 4.2.3.0 17.5.2013
in our application programed in Delphi7.
Here we use a descendat of TSQLDataSet to deal with our Firebird DB (Server version: WI-V6.3.2.26539 Firebird 2.5). With initialising our application the user logs into the database - so that SQLConnection.Connected is set to true until the user loggs out.
The standard process to get data is
- define a query in SQLDataset.CommandText
- prepare the SQLDataset
- set the SQL parameters in the SQLDataset
- set SQLDataset.Active := True
- set Active := True in an ClientDataSet (connected via TDataSetProvider to the SQLDataSet)
- set SQLDataset.Active := False
We use the CDS in the application and so we try to minimize the time where the connection to the database is used for datatransfer.
Our problem is:
due to somtimes bad WLan connection we loose the contact to the DB. That kills our application. The extended driver options "reconnect" is left to the default value (True).
My question is:
is there a way to "check" within the TSQLConnection scope, that the connection to the db is working befor a query is sent to the db. Or is there a way to do this within our
SQLDataSet (e.g. in BeforeOpen).
Thanks for any suggestion here.
we use
dbxida42.exe filedate 7.6.12 with version dbexpida.dll ist 4.2.3.0 17.5.2013
in our application programed in Delphi7.
Here we use a descendat of TSQLDataSet to deal with our Firebird DB (Server version: WI-V6.3.2.26539 Firebird 2.5). With initialising our application the user logs into the database - so that SQLConnection.Connected is set to true until the user loggs out.
The standard process to get data is
- define a query in SQLDataset.CommandText
- prepare the SQLDataset
- set the SQL parameters in the SQLDataset
- set SQLDataset.Active := True
- set Active := True in an ClientDataSet (connected via TDataSetProvider to the SQLDataSet)
- set SQLDataset.Active := False
We use the CDS in the application and so we try to minimize the time where the connection to the database is used for datatransfer.
Our problem is:
due to somtimes bad WLan connection we loose the contact to the DB. That kills our application. The extended driver options "reconnect" is left to the default value (True).
My question is:
is there a way to "check" within the TSQLConnection scope, that the connection to the db is working befor a query is sent to the db. Or is there a way to do this within our
SQLDataSet (e.g. in BeforeOpen).
Thanks for any suggestion here.