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;
当主键项为空时,报错!
又不知如何得到错误代码。
特请教?