A
ATY
Unregistered / Unconfirmed
GUEST, unregistred user!
程序第二次运行到ADODS1 的active:=false时报错“BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。”ADODATASET 简写为 ADODS1 、ADODS12 with DM.ADODS1 do begin Active:=false; CommandText:='select distinct br_no from sms_num order by br_no '; Active:=True; end; DM.ADODS1.First; while not DM.ADODS1.Eof do begin //1 with DM.ADODS2 do begin ????第一遍没有问题,当第二次循环到这里时就报错 Active:=false; CommandText:='select a.no,round(b.byear/100000000,1) ' +'from sms_zb a left outer join news b on ' +'(a.zb=b.zb and a.ccy=b.ccy) ' +'where b.br_no='''+DM.ADODS1.Fields[0].AsString+''' ' +'order by a.no '; Active:=True; end; //格式匹配 DM.ADODS2.First; {while not DM.ADODS2.Eof do begin Str:=StringReplace(Str,'*',DM.ADODS2.Fields[1].AsString,[rfIgnoreCase]); DM.ADODS2.Next; end;} {//插入sms_content with DM.ADOCMD1 do begin CommandText:='insert into sms_content values('''+DM.ADODS1.Fields[0].AsString+''','''+Str+''')'; Execute; end; } //showmessage(DM.ADODS1.Fields[0].AsString); DM.ADODS1.Next; end; //1