try 
  //do your self 
except
  //出错处理

解决方案 »

  1.   

    try
          dt:=date;
          datetimetostring(tmpstr , 'yyyy-mm-dd' , dt);
          adoq_pubf1.Connection:=datamodule2.ADOCon_pubf;
          adoq_pubf1.SQL.Clear;
          adoq_pubf1.SQL.Add('insert into sys_log ');
          adoq_pubf1.sql.Add(' values('+tmpstr+',');
          adoq_pubf1.sql.Add(' '''+uid+''',  ');
          adoq_pubf1.sql.Add(' '''+event+''',');
          adoq_pubf1.sql.Add(' '''+memo+''') ');
          rt:=adoq_pubf1.execsql;
        except
          on EDatabaseError do showmessage('数据库操作失败,请检查数据!');
        end;但还是出现了系统的错误提示!!!(这是一个函数的内容)
      

  2.   

    tryexcept
    //你的出错提示。
    end;或者unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      AppEvnts;type
      TForm1 = class(TForm)
        ApplicationEvents1: TApplicationEvents;
        procedure ApplicationEvents1Exception(Sender: TObject; E: Exception);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.ApplicationEvents1Exception(Sender: TObject;
      E: Exception);
    begin
       showmessage('数据库操作失败,请检查数据!');任何出错都会到这里来。
    end;end.
      

  3.   

    function f_syslog(uid :string ; event:string ; memo :string):boolean;
      var
        dt:TDateTime;
        tmpstr:string;
        adoq_pubf1:TADOQuery;
      begin
        adoq_pubf1:=TADOQuery.Create(nil);
        try
          dt:=date;
          datetimetostring(tmpstr , 'yyyy-mm-dd' , dt);
          adoq_pubf1.Connection:=datamodule2.ADOCon_pubf;
          adoq_pubf1.SQL.Clear;
          adoq_pubf1.SQL.Add('insert into sys_log ');
          adoq_pubf1.sql.Add(' values('+tmpstr+',');
          adoq_pubf1.sql.Add(' '''+uid+''',  ');
          adoq_pubf1.sql.Add(' '''+event+''',');
          adoq_pubf1.sql.Add(' '''+memo+''') ');
        except
          on EDatabaseError do showmessage('数据库操作失败,请检查数据!');
        end;上面各位的方法我都已经试了没效果!这是完整的代码段!请帮忙分析,为什么会有这种不出提示框的问题?!!!