function RecordExists(id:Integer):boolean;
begin
with adoquery1 do
begin
Close;
sql.text:=format('select Count(*) from test where id=%d',[id]);
Open;
Result:=Fields[0].asInteger>0;
Close;
end;
end;
begin
with adoquery1 do
begin
Close;
sql.text:=format('select Count(*) from test where id=%d',[id]);
Open;
Result:=Fields[0].asInteger>0;
Close;
end;
end;
ShowMessage('没有找到符合条件的记录');
ShowMessage('No');
if ADOQuery1.IsEmpty then
ShowMessage('No');
showmessage('没有数据存在')
else
showmessage(‘一共有'+inttostr(adoquery1.recordcount)+'条记录');