When there is a disconnection I use the OnConnectionLost event in this way to reconnect, before trying to reconnect I ask the user if he wants to reconnect (this makes sense because may be he incidentally unplugged a LAN cable or switched off wireless).
This is the code I use, I removed things specific to my app, I just left the SDAC part:
Code: Select all
procedure TForm1.OnConnectionLost(Sender: TObject; Component: TComponent; ConnLostCause: TConnLostCause; var RetryMode: TRetryMode); begin if MsgBox('Connection lost detected. Do You want to try to reconnect?', MB_ICONWARNING + MB_YESNO) = mrYes then RetryMode := rmReconnectExecute else begin RetryMode := rmRaise; Application.Terminate; end; end;
External Exception: C00000006
I must kill the application in Task Manager.
May you give some advice about that external exception?