procedure filterr(Dataset: TDataSet; const FieldName, SearchTerm: string);
begin
Assert(Assigned(Dataset), 'No dataset is assigned');
if SearchTerm = '' then
Dataset.Filtered := False
else
begin
Dataset.Filter := FieldName + ' LIKE ' + QuotedStr(SearchTerm + '*');
Dataset.Filtered := True;
end;
end;
adotable1.filter := 'name' + 'like' +QuotedStr(edit1.text + '*');
filterr(adotable1,'name',edit1.text)