type
TYWXX2 = class(TInfo)
DataSetBZSJJ1: TSQLDataSet;
procedure DataSetBZSJJ1BeforeDelete(DataSet: TDataSet);
private
{private declarations}
procedure DoDeleteError(DataSet: TAbstractDataSet; E: EDatabaseError;
var Action: TDataAction);
public
{public declarations}
end;
implementation
procedure TYWXX2.DataSetBZSJJ1BeforeDelete(DataSet: TDataSet);
begin
if not DataSet.Fields[0].IsNull then
begin
DataSet.ReadOnly := True;
DataSet.OnDeleteError := DoDeleteError;
end;
end;
procedure TYWXX2.DoDeleteError(DataSet: TAbstractDataSet; E: EDatabaseError;
var Action: TDataAction);
begin
(DataSet as TDataSet).ReadOnly := False;
E.Message := '不能删除';
end;