功能----给每个记录加个序号,代码如下:
total:=1;
delQuery.Close;
DelQuery.SQL.Clear;
DelQuery.SQL.Add('select * from ylf');
DelQuery.Open;
while not delQuery.Eof do begin
delQuery.Edit;
delQuery.FieldByName('bz3').AsString :=IntToStr(total);
total:=total+1;
delquery.Next;
end;
请问为什么上面的语句进入了死循环?
我该如何给每个记录加个序号?
total:=1;
delQuery.Close;
DelQuery.SQL.Clear;
DelQuery.SQL.Add('select * from ylf');
DelQuery.Open;
while not delQuery.Eof do begin
delQuery.Edit;
delQuery.FieldByName('bz3').AsString :=IntToStr(total);
total:=total+1;
delquery.Next;
end;
请问为什么上面的语句进入了死循环?
我该如何给每个记录加个序号?
解决方案 »
- string.Format
- 求DXDBGRID的详细使用技巧
- 最近做了一个三层的考试系统,其它还可以,就是机器如果太多的话,提取题时很慢,因为我是一次性的全部提取100套题....
- 不是问题的大问题
- 关于dbgrid的问题
- 如何取得ADOQuery返回的数据记录总数?
- 智能桩考图像跟踪算法
- 请问我得断点为什么不好使?
- ??????????????请各位大虾们帮忙解个小问题,关于空的数据表的问题????????????????????
- 怎样使用http://www.soapengine.com/lucin/soapenginex/smsx.asmx?wsdl里面的web服务,拜托各位大虾了!
- 高兴,散分!
- 第39题):delphi的帮助怎么也错了?
total:=1;
delQuery.Close;
DelQuery.SQL.Clear;
DelQuery.SQL.Add('select * from ylf');
DelQuery.Open;
delQuery.Edit;
DelQuery.first; //ADD
for I;=0 to DelQuery.datebase...Count-1 do //DelQuery.datebase...Count为记录数
begin
delQuery.FieldByName('bz3').AsString :=IntToStr(total);
total:=total+1;
delquery.Next;
end;
//最后一条那就一直运行下去。你说能不死循环吗?
delQuery.Edit;
delQuery.FieldByName('bz3').AsString :=IntToStr(total);
total:=total+1;
delquery.Next;
end;
如果是死循环,单步调试的时候应能一直进行下去, 运行应该也不会提示呀 可能是某些方面有问题,不一定是死循环
total:=1;
delQuery.Close;
DelQuery.SQL.Clear;
DelQuery.SQL.Add('select * from ylf');
DelQuery.Open;
while not delQuery.Eof do begin
delQuery.Edit;
delQuery.FieldByName('bz3').AsString :=IntToStr(total);
total:=total+1;
delquery.Next;
end;
DelQuery.EnableControls;
其它哪里有问题吧
with DelQuery do
begin
close;
sql.clear;
sql.add('select * from ylf');
open;
while not Eof do
begin
edit;
fieldbyname('bz3').AsString := InttoStr(RecNo);
Next;
end;
end;
返回的结果竟然不一样,不是我亲自碰见我简直不敢相信!!!
你怎么把它丢了