我想从表的第一条记录开始,依次对每条记录进行操作,请问该用什么样子的语句?我很菜的,大家不要见笑啊。

解决方案 »

  1.   

    do while not Rs.Eof
       Rs.move next
    loop
      

  2.   

    Dim mRst As New ADODB.Recordset
    mRst.CursorLocation = adUseClient
    mRst.Open "Select * From Table1",mCnnString,3,3   'mCnnString是你的连接字符串
    Do While Not mRst.Eof
       mRst.Field(0) = ...
       mRst.Field(1) = ...
       ......
       mRst.Move Next
    Loop
      

  3.   

    dim sqlstr as string 
    dim rs as new recordset
    SqlStr = "从数据库中读出"
    Set rs = Cw_DataEnvi.DataConnect.Execute(SqlStr)
    do while rs.EOF Then
        rs.move next
    loop
      

  4.   

    if rs.recordcont>0 then
       rs.movefirst
       do while not rs.eof
            '进行操作……
            
            rs.movenext
       loop
    endif