procedure TForm1.Button1Click(Sender: TObject);
var
isExist:Boolean;
begin
ADOQuery1.SQL.Text:='你的SQL语句';
ADOQuery1.Open;
If ADOQuery1.Eof then // 判断查询结果是否为空
begin
isExist:=False; // 变量设为假
end;
end;
adoquery.sql.text('select * from xxx ');
adoquery.open;
if adoquery.locate(字段名, 某个值, [loPartialKey]) then
result:= 1;
sqlstr := 'select count(*) as cnt from table where 你的条件';
adoquery1.sql.text := sqlstr;
adoquery1.open;
if adoquery1.fieldbyname('cnt') > 0 then
showmessage('1');
adoquery.sql.add('select id from xxx where 字段=xx ');
adoquery.open;
result=adoquery.recordnum;
count(*)下
然后取ADOQuery的返回数值
0就是没有 》=1为有