看似无限循环

Seemingly infinite loop

这个循环应该在行中循环,当它到达终点时它应该退出循环。好像卡住了不退出。我在不同的宏中使用了几乎相同的循环,为什么这个循环在这里不起作用?

    If not rs2.eof Then
        rs2.movefirst
        Do until rs2.eof

            Set ORDERLINE = ORDERLINES(CInt(rs2("ROW"))-1).VALUE

            If ORDERLINE("udfStringCol8") = trim(group) Then
                For i = 0 to (Lcnt - 1) 
                    Set ORDERLINE = ORDERLINES(i).VALUE
                    objExcel.Cells(i+2, 1).Value = ORDERLINE("PART_ID")
                    objExcel.Cells(i+2, 2).Value = ORDERLINE("DESCRIPTION")
                    objExcel.Cells(i+2, 3).Value = ORDERLINE("USER_3")
                    objExcel.Cells(i+2, 4).Value = ORDERLINE("USER_6") 
                    objExcel.Cells(i+2, 5).Value = ORDERLINE("USER_8")
                    objExcel.Cells(i+2, 6).Value = ORDERLINE("USER_7")
                    rs2.movenext
                Next    
            End If
        loop 
    End If
    rs2.close
    Do until rs2.eof
        If ORDERLINE("udfStringCol8") = trim(group) Then ' this doesn't happen
        'some code here
          rs2.movenext ' So this doesn't move next
        End If
    loop