B
baggio_t
Unregistered / Unconfirmed
GUEST, unregistred user!
程序代码如下:
begin
for t:=0 to adoquery2.recordcount-1 do
begin
FileNo:=trim(adoquery2.fieldbyname('文件号').AsString);
dbedit2.Text:=fileno;
showmessage(fileno);
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from old where 文件号='''+fileno+'''');
open;
end;
adoquery2.Next;
end;
问题是:adoquery2.next这句始终得不到正确的结果,但是奇怪的是,如果把中间这段去掉, close;
sql.Clear;
sql.Add('select * from old where 文件号='''+fileno+'''');
open;
结果就正常了,谁能告诉我怎么回事?
begin
for t:=0 to adoquery2.recordcount-1 do
begin
FileNo:=trim(adoquery2.fieldbyname('文件号').AsString);
dbedit2.Text:=fileno;
showmessage(fileno);
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from old where 文件号='''+fileno+'''');
open;
end;
adoquery2.Next;
end;
问题是:adoquery2.next这句始终得不到正确的结果,但是奇怪的是,如果把中间这段去掉, close;
sql.Clear;
sql.Add('select * from old where 文件号='''+fileno+'''');
open;
结果就正常了,谁能告诉我怎么回事?