procedure TForm3.Table2PostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
type
tintrec=record
lo,hi:byte;
end;
var
i:word;
p:longint;
q:longint;
begin
//i:=(E as EDBENGINEError).Errors[0].ErrorCode;
// p:=tintrec(i).lo;
//q:=tintrec(i).hi;
//howmessage(inttostr(p));
if (E as eDBENGineError).Errors[0].Errorcode=13059 then
begin
showmessage('1');
messagedlg('不能为空)!',mtwarning,[mbok],0);
abort;
end
else
begin
if (E as eDBENGineError).Errors[0].Errorcode=9729 then
begin
showmessage('2');
messagedlg('该人员信息已经被输入!也可能是工号重复了,请重新输入!',mtwarning,[mbok],0);
abort;
end
else
begin
showmessage('3');
//messagedlg('错误码:'+i,mtwarning,[mbok],0);
abort;
end;
end;
end;
当主键项为空时,报错!
又不知如何得到错误代码。
特请教?
var Action: TDataAction);
type
tintrec=record
lo,hi:byte;
end;
var
i:word;
p:longint;
q:longint;
begin
//i:=(E as EDBENGINEError).Errors[0].ErrorCode;
// p:=tintrec(i).lo;
//q:=tintrec(i).hi;
//howmessage(inttostr(p));
if (E as eDBENGineError).Errors[0].Errorcode=13059 then
begin
showmessage('1');
messagedlg('不能为空)!',mtwarning,[mbok],0);
abort;
end
else
begin
if (E as eDBENGineError).Errors[0].Errorcode=9729 then
begin
showmessage('2');
messagedlg('该人员信息已经被输入!也可能是工号重复了,请重新输入!',mtwarning,[mbok],0);
abort;
end
else
begin
showmessage('3');
//messagedlg('错误码:'+i,mtwarning,[mbok],0);
abort;
end;
end;
end;
当主键项为空时,报错!
又不知如何得到错误代码。
特请教?
解决方案 »
- 求tcpsever 函数sendto和ReceiveFrom函数的参数说明!
- 将图片和文字存入数据库的方法都有哪些呢?
- ~~~~~~ADOQuery的问题
- 数据方面的问题。
- DBGrideh标题排序
- 如何得到用户在百度里面搜索的关键字?
- 有广州兄弟吗?我想到广州走走!!!!
- 在线等待20分钟,然后结帐。 寻找中文帮助文件制作软件,英文简单好用的也可以。
- 谁能推荐一款电子邮件服务器,具体要求内详~~~
- 数据量小时,dbgrid中提交后出现重复记录是什么原因? 在线等!着急啊!
- 如何让鼠标移到edit上时,edit里面的里面被选种?
- 求《Delphi 7实用程序设计100例》或《Delphi 6实用程序设计100例》电子书
看看e.message
showmessage(e.message);
提示错误仍是以前的错误?
里
这样就行了
showmessage('数据库错误!')