procedure TForm1.DBISAMTable1BeforePost(DataSet: TDataSet);
begin
if Dataset.Lookup('Name','AAA','Name')=false then Abort;
end;
//=======================================================================
function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; virtual;
Checks whether the dataset is unidirectional, and if so, raises an EDatabaseError exception.
Returns a Variant with the value False《找不到返回false》, indicating that a matching record was not found.
Descendant classes that are not unidirectional override this method so that it locates the record where the fields identified by the comma-delimited string KeyFields have the values specified by the Variant or Variant array KeyValues. In classes that implement Lookup, it returns a Variant or Variant array that contains the value or values of the fields specified by the comma-delimited string ResultFields on the specified record.