拦错误:
if (E is EDBEngineError) then
with (E as EDBEngineError)do
begin
iDBIError :=Errors[0].Errorcode;
case iDBIError of
9732: MessageDlg('必输字段不能为空', mtWarning, [mbOK], 0);
9729: MessageDlg('键值重复', mtWarning,[mbOK], 0);
9733: MessageDlg('主数据丢失', mtWarning,[mbOK],0);
9734: MessageDlg('主表已有明细,不能删除或修改',mtWarning, [mbOK], 0);
10000: MessageDlg('不正确的数据类型',mtWarning, [mbOK], 0);
10024: MessageDlg('数据表不存在',mtWarning, [mbOK], 0);
13059: //SQL语句错误
begin
iSQLError:=Errors[0].NativeError;
if ErrorCount>=1 then
MessageDlg(Errors[1].Message,mtWarning, [mbOK], 0);
end;
13060: MessageDlg('数据表已存在',mtWarning, [mbOK], 0);
end;
end;
还有其它代码:记得以前有一个BDE错误信息的!慢慢汉化去吧!