怎么把记录集里的元素用循环写出来

来源:百度知道 编辑:UC知道 时间:2024/09/25 01:52:56
我用的是ACCESS数据库,通过recordset记录集导出来后的有15个元素.怎么才能把他们一一循环写出来.
我的查询语句是:strselectsql="select top 15 * from picture order by pictureid desc"
现在要把查询出来的每个记录分别写出来怎么办??
一楼的,这样可以吗
rs(0)("pictureaddress")

rs("pictureaddress")

'pictureaddress 为你数据库的字段名

'rs(0) 表示那个表的第一个字段的值

if not rs.eof then
rs(0)'第一个
end if
rs.movenext
if not rs.eof then
rs(0)'第二个
end if
rs.movenext
if not rs.eof then
rs(0)'第三个
end if
…………

rs.movenext 表示指向下一条记录

do while not rs.eof
response.write rs("pictureaddress")
rs.movenext
loop