Ver Mensaje Individual
  #2  
Antiguo 23-10-2017
Avatar de Soa Pelaez
Soa Pelaez Soa Pelaez is offline
Miembro
 
Registrado: nov 2015
Posts: 133
Reputación: 9
Soa Pelaez Va por buen camino
Post

Buen día, una solución podría ser capturando el error en el evento OnError del TFDConnection

Código Delphi [-]

procedure TFDConnection.FDConnectionOnError(ASender,
  AInitiator: TObject; var AException: Exception);
var
  oExc: EFDDBEngineException;
begin
  if (AException is EFDDBEngineException) and (EFDDBEngineException(AException).Kind = ekRecordLocked) then
   AException.Message := 'Please, try the operation later. At moment, the record is busy';

  if AException is EFDDBEngineException then
  begin
    oExc := EFDDBEngineException(AException);
    if oExc.Kind = ekRecordLocked then
      oExc.Message := 'Mensaje cuando el registro está bloqueado'.
    else
    if (oExc.Kind = EkServerGone) then //and SameText(oExc[0].ObjName, 'UniqueKey_Orders') then
      oExc.Message := 'No hay Conexión a la base de datos'
    else
      oExc.Message:= 'Sucedio Otro tipo de error del lado del Servidor'  ;
  end;

end;
Responder Con Cita