Table1.open;
Table1.first;
Try
   While not table1.eof do begin 
   Table1.edit;
   ...
finally
   Table1.post;
   Table1.close;
end;

解决方案 »

  1.   

    while not eof do这个应该指定是
    while not table1.eof do begin
      

  2.   

    while not eof do
      begin
      if table1.FieldByName('日期').asdatetime-strtodatetime(trim(edit3.text))>0 then
        break;//如果条件是真,那么Table1怎么向下移,其他同楼上
      

  3.   

    BS():
    if table1.FieldByName('日期').asdatetime-strtodatetime(trim(edit3.text))>0 then
        break;//如果条件为真,则结束循环呀 delphi0302(好好学习,天天向上!) :
    while not table1.eof do begin
    //这么加了后还是不行呀
      

  4.   

    又看了一遍,除了EOF好象没什么错误,是什么错误,语法错误,还是逻辑错误;
    另外,你用到的变量都是全局变量吗?是不是有点浪费
      

  5.   

    BS():
    若是whlie not eof do begin
    则有如下错误:Project Project1.exe raised exception class EInOutError with message 'I/O error104'. Process stoped. use step or Run to contunue.
    若是while table1.eof do begin
    则有如下错误:
    Project Project1.exe raised exception class EDatabaseError with message 'Table1:Dataset not in edit or insert mode'.Process stoped. use step or Run to contunue.
    为什么要Table1处在编辑或插入状态?我只是读取数据呀!还有。我用的是私有变量。在这个单元中还有别有函数要用到。
      

  6.   

    的确有点怪!单看这段代码,是不需要table1处于编辑状态呀!
    你在打开表之后加上一个table。open 试试。如果通过则是你不注意可能写表了!
    你的table1变量是全局的还是局部的?你可以单步跟一下程序,看在哪个地方出错,应该不是大问题的。
      

  7.   

    abin16() :我在table1.open后加了table1.edit;或table1.insert;结果还是出现第二个错误!