千克的英文单词:~~告急~读取后4条记录

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/01 00:06:44
<%
set rs=server.createobject("adodb.recordset")
i=0
MaxShangpinList=4

rs.open "select * from shop_snsn where cxiaoshop=1 order by sx desc",conn,1,1
%>
<%
do while not rs.eof
i=i+1
%>
现在是读取前4个记录
怎么读取最后4个记录啊~~

答复共 1 条
后4条记录阿?!可以实现阿
先将记录指针移动到最后然后再做个循环读取就可以了:

..... (前面的程序就省略了。呵呵)
rs.movelast (记录指针移动到最后)
for i=1 to 4 (循环4次)
... (显示记录内容)
...
rs.moveprevious (记录指针移动到上一条)
next (下一次循环)

麻烦将完整的代码写给我..
晕~~CyberGenius 只显示最后一个啊~~

<%
set rs=server.createobject("adodb.recordset")
i=0
MaxShangpinList=4

rs.open "select * from shop_snsn where cxiaoshop=1 order by sx desc",conn,1,1
%>
<%
rs.movelast
do while not rs.eof
i=i-1
%>