with FrmDataMod.TempQ do
begin
Close ;
SQL.Clear;
SQL.Add('select abill_no,card_no,sum(unit_pric) from charttypes ');
SQL.Add('where serve_type='+#39+s+#39);
SQL.Add('group by abill_no,card_no');
open;
first;
while not eof do
begin
card_no:=fieldbyname('card_no').AsString;
//行1
// sex_women:=sex_women+1;//行n
showmessage(card_no);
next;
end;
end;
先查询一个表,然后对查询得到的记录进行处理(主要是统计操作)
在循环处理这个表的时候,如果不加其他语句(行1...行n)之间,则循环正常,可以通过showmessage()证实有若干记录,如果在行1...行n之间插入一条哪怕是非常简单的的语句比如一条付值语句,循环就退出了,奇怪,大家有碰到类似现象吗?怎么解决?搞了2天了
begin
Close ;
SQL.Clear;
SQL.Add('select abill_no,card_no,sum(unit_pric) from charttypes ');
SQL.Add('where serve_type='+#39+s+#39);
SQL.Add('group by abill_no,card_no');
open;
first;
while not eof do
begin
card_no:=fieldbyname('card_no').AsString;
//行1
// sex_women:=sex_women+1;//行n
showmessage(card_no);
next;
end;
end;
先查询一个表,然后对查询得到的记录进行处理(主要是统计操作)
在循环处理这个表的时候,如果不加其他语句(行1...行n)之间,则循环正常,可以通过showmessage()证实有若干记录,如果在行1...行n之间插入一条哪怕是非常简单的的语句比如一条付值语句,循环就退出了,奇怪,大家有碰到类似现象吗?怎么解决?搞了2天了
用你的方法测试了,也可以取出若干记录
能说明什么呢?
first;
while not eof do
begin
next;
card_no:=fieldbyname('card_no').AsString;
showmessage(card_no);
end;
恼人的delphi