if rs.absoluteposition = 1 then
msgbox "first record"
endifif rs.absoluteposition = rs.recordcount then
msgbox "last record"
endif

解决方案 »

  1.   

    if not rs.eof then
    while rs.movenext
        msgbox rs("子段名").value
        ..
    wend
    end if
      

  2.   

    To: of123() ( )
    当rs.MoveNext 是,rs.absoluteposition 的值一直都是-1,并没有发生改变啊。也不会等于1了。
      

  3.   

    你用的CursorType不对,你可以设置:
    rs.CursorType=adOpenStatic(静态)/adOpenKeyse(键集)
    不能是动态(adOpenDynamic)/只向前(adOpenForwardOnly)
    这样用
    if rs.absoluteposition = 1 then
    msgbox "first record"
    endifif rs.absoluteposition = rs.recordcount then
    msgbox "last record"
    endif
    就可以了
      

  4.   

    if rs.absoluteposition = 1 then
    msgbox "first record"
    end ifif rs.absoluteposition = rs.recordcount then
    msgbox "last record"
    end if
      

  5.   

    rs.movenext
    if rs.eof then
       最后一条
    end if
    rs.moveprior
      

  6.   

    dim bk as variant
    bk = rs.Book
    rs.movefirst
    if rs.CompareBooks(bk, rs.Book) = adCompareEqual then
       msgbox "First Record"
    Else
       rs.book = bk
    end if