Digite em 'Pesquisar Dica' o que deseja procurar. Ex: DBGRID
PESQUISAR DICA:
TRATAMENTO DE ERRO - VIA EVENTO ONEXCEPTION DO OBJETO APPLICATION
implementation Uses DB, Unit2; {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin Application.OnException := Trata_Erros; end; procedure TForm1.Trata_Erros( Sender:TObject; E:Exception); var Form : TComponent; begin if E is EDBEngineError then begin ShowMessage((E as EDBEngineError).Message); end else if E is EDataBaseError then begin ShowMessage((E as EDataBaseError).Message); end else if E is EConvertError then begin ShowMessage(Screen.ActiveForm.Caption + ': '+ (E as EConvertError).Message); end else begin ShowMessage(E.Message); end; end;