例如: procedure TForm1.ADOQuery1NewRecord(DataSet: TDataSet); begin if ADOQuery1.RecordCount >= 21 then ADOQuery1.Cancel; end;