也许楼上的回答运行起来没错,但实际有错应该是:do while not rs.eof and not rs.bof是and 不是or。意思是:只有不是记录的结尾并且也不是记录的开头时才循环
do while not rs.eof or rs.bof 写错了吧!do while not rs.eof or not rs.bof