if rs.absoluteposition = 1 then
msgbox "first record"
endifif rs.absoluteposition = rs.recordcount then
msgbox "last record"
endif
msgbox "first record"
endifif rs.absoluteposition = rs.recordcount then
msgbox "last record"
endif
while rs.movenext
msgbox rs("子段名").value
..
wend
end if
当rs.MoveNext 是,rs.absoluteposition 的值一直都是-1,并没有发生改变啊。也不会等于1了。
rs.CursorType=adOpenStatic(静态)/adOpenKeyse(键集)
不能是动态(adOpenDynamic)/只向前(adOpenForwardOnly)
这样用
if rs.absoluteposition = 1 then
msgbox "first record"
endifif rs.absoluteposition = rs.recordcount then
msgbox "last record"
endif
就可以了
msgbox "first record"
end ifif rs.absoluteposition = rs.recordcount then
msgbox "last record"
end if
if rs.eof then
最后一条
end if
rs.moveprior
bk = rs.Book
rs.movefirst
if rs.CompareBooks(bk, rs.Book) = adCompareEqual then
msgbox "First Record"
Else
rs.book = bk
end if