Ver Mensaje Individual
  #2  
Antiguo 13-06-2007
loxod loxod is offline
Miembro
 
Registrado: feb 2007
Ubicación: Mexico
Posts: 45
Reputación: 0
loxod Va por buen camino
pudiera usar algo como lo siguiente:

Código Delphi [-]
procedure TForm1.AppExcept(Sender : TObject; E : Exception);
begin
// Valida que la BD no marque error de tipos
   if  (Pos('DUPLICATE ENTRY',UpperCase(e.Message)) > 0) then
     begin

     end else
   if Pos('IS NOT A VALID FLOATING POINT',UpperCase(e.Message)) > 0 then
     MessageDlg('El tipo de Datos es Invalido.' + #13 + #10 +
     'Verifiquelo por Favor', mtWarning, [mbOK], 0)
   else
   if Pos('IVA',UpperCase(e.Message)) > 0 then
     MessageDlg('El I.V.A. esta fuera del rango (0-50).' + #13 + #10 +
     'Verifiquelo por Favor', mtWarning, [mbOK], 0)
     else
   if Pos(QuotedStr('ENTREGADO') + ' MUST HAVE A VALUE',UpperCase(e.Message)) > 0 then
     MessageDlg('El campo de Entregado debe tener un Valor' + #13 + #10 +
     'Verifiquelo por Favor', mtWarning, [mbOK], 0)
      else
       begin
           MessageDlg('Ha Ocurrido un Error en el Sistema.' + #13 + #10 +
                      'Intente de Nuevo la Operacion', mtWarning, [mbOK], 0);
       end;
end;

y en el oncreate de la forma

Código Delphi [-]

procedure TForm1.FormCreate(Sender: TObject);
begin
    Application.OnException := AppExcept;
end;
Responder Con Cita