Re: Lost connection
- From: "OMRANAFZAR.COM" <omranafzar@xxxxxxxxx>
- Date: Thu, 28 Jun 2007 00:32:48 -0700
On Jun 28, 1:01 am, "Arjan de Haan \(ha\)" <2x nospam nospam adwhaan
AT hotpop.com> wrote:
"Shaolin" <milos.kl...@xxxxxxxxx> schreef in berichtnews:468277c6@xxxxxxxxxxxxxxxxxxxxxxxxx
Sorry I forgot notice that I don't want use try except block. I want to
detect this disconnection using some ado function or property or another way.
Hm. ADO does not recognize the disconnection from the database until it tries to talk to
it - when executing queries, for example. Not sure if there are any special functions to
call in order to detect the disconnect.
One way of detecting it would be to 'ping' the IP address (assuming you can reach the
server by TCP/IP) and set a flag if the server does not respond in time.
But why refrain from using exceptions? This sort of situations are what try...except
blocks are designed for.
In the last data access layer I wrote I too needed to cater for losing connections due to
mobile Windows Embedded stations which could move out of the wireless network range for
short periods. I resolved it nicely using exception handling. The applications just
execute queries and when the connection has been lost, in the background there are several
attempts made to reconnect - all without the front end even knowing. It only takes longer
to get the data or possible receive an error that the database can't be reached now. When
they move within network range, all the operators need to do is refresh or refire the
query they were trying to execute and the connection is reestablished. Works like a
charm - and with exception handling....
...Arjan...
i think u can handle the error raised from onwillexecute of
tadoconnection
.
- References:
- Re: Lost connection
- From: Arjan de Haan \(ha\)
- Re: Lost connection
- Prev by Date: Re: Lost connection
- Next by Date: Re: Lost connection
- Previous by thread: Re: Lost connection
- Next by thread: Re: Lost connection
- Index(es):
Relevant Pages
|