应该是你删除条件不对吧.look

解决方案 »

  1.   

    with maindata.adotbl_month do
    begin
      while not eof do delete;
    end;
      

  2.   

    with maindata.adotbl_month do
        begin
         first;
         while not eof do
         begin
           delete;
         end;
       end;
      

  3.   

    不能用next,用first可以了
      

  4.   

    楼上的说的不对啊,你没有循环..
    用标准的SQL写好了..
      

  5.   

    with maindata.adotbl_month do
        begin
         first;
         while not eof do
         begin
           delete;
           first;
         end;
       end;
      

  6.   

    with maindata.adotbl_month do
        begin
         first;
         while not eof do
         begin
         delete;
         post;  //!!!
         next;
         end;
       end;
      

  7.   

    with maindata.adotbl_month do
        begin
         first;
         while not eof do
         begin
         delete;
         post;  //!!!
         first; //!!!
         end;
       end;
      

  8.   

    注意:
          错在多了一个“next”!
    why?
    因为:delete后,记录指针已经移动到了下一条,而你next后,指针又向下移动了一条!
    因此,每一次都不能全部删除,假如共有n条纪录,每次只能删除2n或2n+1条!