qtmp.First;
        while not qtmp.Eof do
        begin
          adomain.insert;
          adomainkaishi.value:=datetimetostr(qtmppdate.value);
          adomain.Post;
          qtmp.delete;
         qtmp.Next;
        end;如果qtmp中有好几个记录,只会插如两个到adomain中,但qtmp却不会删除
这是为什么?

解决方案 »

  1.   

    qtmp.First;
            while not qtmp.Eof do
            begin
              adomain.insert;
              adomainkaishi.value:=datetimetostr(qtmppdate.value);
              adomain.Post;
              qtmp.delete;
             //qtmp.Next;//delete
            end;
      

  2.   

    楼主把qtmp.Next那句去掉试试,好像qtmp.delete一执行成功游标会自动到下一条记录
      

  3.   

    qtmp.First;
            while not qtmp.Eof do
            begin
              adomain.insert;
              adomainkaishi.value:=datetimetostr(qtmppdate.value);
              adomain.Post;
              qtmp.delete;
             qtmp.Next;///多余的,Delete执行完后,当前记录号会自动下移。
            end;