比如说rstemp有三行数据,是不是rstemp.Fields("FAmount2")就有三个值?请详细解答,最好是带出一些相关的属性。

解决方案 »

  1.   

    不是,首先你要使用rstemp.movefirst,这样得到的就是第一行的数据,rstemp.movenext得到的就是下一行的数据rstemp.movefirst
    do while not rstemp.eof 
        msgbox rstemp.Fields("FAmount2")
        rstemp.movenext
    loop
      

  2.   

    呵呵rstemp.Fields("FAmount2")
    要和rstemp.movenext
    联合使用
    指针下移一行,读取一行数据
    看看这个例子
    yp.Open "select * from table ", Cnn, adOpenKeyset, adLockOptimistic if yp.recordcount>0 then
        With MSFGrid1 
            .rows=yp.recordcount+1
            while not yp.eof
                i=i+1                 .TextMatrix(i, 1) = yp.Fields("hh1") & ""
                  .TextMatrix(i, 2) = yp.Fields("kj1")  & "" 
                   ……
                    
                    yp.movenext 
                End If 
            wend 
        End With
    end if
    yp.close