We received this message when I lost the connection on the server is off
Can`t Connect to MySQL on '192.168.1.141' (10061)
Socker Error on connect. WSAgetlastError return 10065($2751)
This message is raise with a beep ,I would like to intercept and show a
friendly messsagebox display and continue with the application and retry in 2 min.
Socket error on connect how to raise with Friendly message
-
Daniel Fagnan
- Posts: 58
- Joined: Fri 13 Oct 2006 00:08
-
swierzbicki
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
Another way to solve this problem is to add an OnError event handler to your TMyConnection object. It may look like this:
Code: Select all
uses
MyCall;
....
procedure TForm1.MyConnectionError(Sender: TObject; E: EDAError;
var Fail: Boolean);
begin
if e.ErrorCode = CR_CONN_HOST_ERROR then begin
ShowMessage('Cannot connect');
Fail := False;
end;
end;OnError event handler - abort?
retry, retry, retry......
connect abort? disconnect, kill connection? etc.?
please example....
connect abort? disconnect, kill connection? etc.?
please example....
Re: OnError event handler - abort?
Please describe the problem in more detail. What example do you mean?oldmanus wrote:retry, retry, retry......
connect abort? disconnect, kill connection? etc.? :?:
please example....
You may be interested in Disconnected Model and Local Failover functionality of MyDAC. See the "Working in an unstable network" topic in MyDAC Help for more information. The FailOver demo demonstrates how does this functionality work. This demo accompanies MyDAC, and is located in the MyDAC installation directory.