recordcount适用于桌面数据库如paradox等,但对于大型数据库有时会发生那样的情况
delphi的帮助里介绍了
要确定是否查找成功最好用
open后用 if not query.isempty then showmessage('it has record')
else showmessage('it has no record ');
我是在QUERY.OPEN后用
with query1 do
begin
close;
sql.clear;
sql.add('select * from .....whrere bh=:tmpbh');
params[0]...........
prepare;
open ;
end;
if query1.recordcount>0 then
返回记录一些值
else
...........