有关sql 语句的问题,如何知道是否查询出记录?(在线等)(10分)

M

mhywbs

Unregistered / Unconfirmed
GUEST, unregistred user!
data2.ADOQuery1.SQL.text:='select * from pawd where admin='''+newuse+''' ';
如何知道是否有适合条件的记录?
用if 语句如何写?
谢谢
 
if data2.adoquery1.isEmpty then showMessage('没有找到合适的记录');
 
ADOQuery1.open
if not adoquery1.eof and not adoquery1.bof then
 
Open后,判断
if ADOQuery1.RecordCount > 0 then
begin
//你的代码
end else
ShowMessage('没有记录');
 
谢谢你们,方法这么多。
可我只有10分不知如何分配?
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
864
import
I
S
回复
0
查看
817
SUNSTONE的Delphi笔记
S
顶部