with   ADOTable1 do begin
  First;
  while not Eof do   begin
      Edit ;   
      ADOTable1.FieldByName('售单号').AsInteger:= 121;
      
      Next;
  end;
  end;
  ADOTable1.UpdateBatch();

解决方案 »

  1.   

    ADOTable1.FieldByName('售单号').AsInteger:= 121;
    ADOTable1.Post;
      

  2.   

    我是以  批处理方式 提交的
    所以错不在这而是,最后一条记录
    根本没有 
    ADOTable1.FieldByName('售单号').AsInteger:= 121;
    的操作谢指教
      

  3.   

    因为在最后一条记录,已经是EOF=TRUE,所以跳出了循环。
    把while not Eof do   begin
    改成for i := 0 to ADOTable1.Recordcount - 1 do begin试试
      

  4.   

    你是用批处理模式,也要先POST的啊。
    同意楼顶的朋友
      

  5.   

    还不行

     while not Eof do   begin
    出现最后一条记录没有更新改成for i := 0 to ADOTable1.Recordcount - 1 do begin提示eof  出错
      

  6.   

    那写多一行代码校验吧。with   ADOTable1 do begin
      First;
      for i := 0 to ADOTable1.Recordcount - 1 do begin
          Edit ;   
          ADOTable1.FieldByName('售单号').AsInteger:= 121;
          
          if not Eof then Next;
          
      end;
      end;
      ADOTable1.UpdateBatch();
      

  7.   

    这样的批处理的话是不是只是最后的一条记录修该了
    别的没有变吧?
    问题出现在
     你的批处理到了最后一条上
    你把
    eof该该
    后把
    ADOTable1.UpdateBatch();
    移位
      

  8.   

    是什么错误啊,说了半天也不知道到底是什么错误,哪一句错了,晕
    另外,EOF和最后一条记录好像不是一码事吧?