(adoquery.Eof and AdoQuery.BOF) (adoQuery.IsEmpty)
同意chechy(我爱洁洁) !
if(not ADOQuery.IsEmpty) then begin //如果数据不为空,则执行 end esle begin //如果数据为空,则执行 end;
if Adoquery.recordcount=0 then 无记录;
adoquery.Close; adoquery.ConnectionString:=database; adoquery.sql.Clear; sqlstr:='select count(*) from database' ; ADOQuery.SQL.Add(sqlstr); adoquery.open; h:=adoquery.Fields[0].AsInteger; if h=0 then begin 无纪录 end;
比较麻烦的方法 第一个adoquery查出来的select * from table where a=b; 第二个adoquery查select count(*) from (select select * from table where a=b); 这个数就是一个记录数
(adoQuery.IsEmpty)
begin
//如果数据不为空,则执行
end esle
begin
//如果数据为空,则执行
end;
adoquery.ConnectionString:=database;
adoquery.sql.Clear;
sqlstr:='select count(*) from database' ;
ADOQuery.SQL.Add(sqlstr);
adoquery.open;
h:=adoquery.Fields[0].AsInteger;
if h=0 then
begin
无纪录
end;
第一个adoquery查出来的select * from table where a=b;
第二个adoquery查select count(*) from (select select * from table where a=b);
这个数就是一个记录数
数据为空
esle
如果数据不为空;