在access如何判断第一条记录跟最后一条记录?

来源:百度知道 编辑:UC知道 时间:2024/05/30 07:14:47
如题

if rs.bof then
表示:当前指针的位置是在第一行记录之前,则...
if rs.eof then
表示:当前指针的位置是在最后一行记录之后,则...
if not rs.eof then
表示:当前指针的位置没有到达最后一条记录
if not rs.bof then
表示:当前指针的位置没有到达第一条记录
-------------------------
###推荐使用下面两条
if not (rs.bof and rs.eof) then
表示:指针位于 RecordSet 的当中(并非是最后一条和第一条) ,说明一定有记录。
if rs.bof and rs.eof then
表示:没有任何记录

RecordSet对象
AbsolutePosition属性
如:
msgbox rs.AbsolutePosition

bof 和 eof