小
小阿文
Unregistered / Unconfirmed
GUEST, unregistred user!
const
eKeyViol = 9729;
implementation
procedure TDM.CustomerPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
if (E is EDBEngineError) then
if (E as EDBEngineError).Errors[0].Errorcode = eKeyViol then
begin
MessageDlg('Unable to post: Duplicate Customer ID.', mtWarning, [mbOK], 0);
Abort;
end;
end;
問題如下:
1.錯誤代碼應是系統內定的呀,為何可以以 const eKeyViol 定義呢?
2.CustomerPostError過程參數 E 是何用?
而 if (E is EDBEngineError) then
if (E as EDBEngineError).Errors[0].Errorcode = eKeyViol then
以是如何理解呢?
3.以上代碼出自 delphi目錄/demos/db/dberror
eKeyViol = 9729;
implementation
procedure TDM.CustomerPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
if (E is EDBEngineError) then
if (E as EDBEngineError).Errors[0].Errorcode = eKeyViol then
begin
MessageDlg('Unable to post: Duplicate Customer ID.', mtWarning, [mbOK], 0);
Abort;
end;
end;
問題如下:
1.錯誤代碼應是系統內定的呀,為何可以以 const eKeyViol 定義呢?
2.CustomerPostError過程參數 E 是何用?
而 if (E is EDBEngineError) then
if (E as EDBEngineError).Errors[0].Errorcode = eKeyViol then
以是如何理解呢?
3.以上代碼出自 delphi目錄/demos/db/dberror