注册 登录
编程论坛 Delphi论坛

数据库查询语句

冰凝1984 发布于 2006-05-28 18:25, 649 次点击
在数据库中第一个房间的状态(status)是‘0’,但是一下代码不能是label19的颜色变为红色,不知道为什么。
哪位高手帮忙指点一下?

sqlstr8:='select roomstatus from roominform';
adoquery5.SQL.Clear ;
adoquery5.SQL.Add(sqlstr8);
adoquery5.Open ;
if (not adoquery5.Eof )
then begin
if adoquery5.FieldValues['roomstatus']='0'
then
label19.Color :=clred;
end;
1 回复
#2
xu20002006-05-29 14:25

把if (not adoquery5.Eof )
then begin这句改为
adoquery5.first;
while not adoquery5.Eof
begin
adoquery5.next;

1