小
小梅
Unregistered / Unconfirmed
GUEST, unregistred user!
我知道用TTable控件可以用下列代码控制:
但TADOTable控件却不知怎办????
procedure TForm1.Table1PostError
(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
begin
if (E is EDBEngineError) then
if (E as EDBEngineError).Errors
[0].Errorcode = eKeyViol then
begin
MessageDlg('出现重复记录!',
mtWarning, [mbOK], 0);
Table1.Cancel;
Abort;
end;
end;
但TADOTable控件却不知怎办????
procedure TForm1.Table1PostError
(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
begin
if (E is EDBEngineError) then
if (E as EDBEngineError).Errors
[0].Errorcode = eKeyViol then
begin
MessageDlg('出现重复记录!',
mtWarning, [mbOK], 0);
Table1.Cancel;
Abort;
end;
end;