急急~大哥!帮我呀!

liao880 2004-05-06 04:47:41
<%
set rs=server.createobject("adodb.RecordSet")
aa="select * from tp where ty='xp' ORDER BY id desc"
rs.open aa,conn,1,3

%>
我现在想取第三条记录,怎么办呀?
...全文
48 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
sn12345678 2004-05-06
  • 打赏
  • 举报
回复
两种方式:
1。 rs.move 2,AdBookmarkFirst
2。(保险一点的方式)
number=3
for i=0 to number-2
if rs.eof = true then exit for
rs.movenext
next
mao1997 2004-05-06
  • 打赏
  • 举报
回复
<%
set rs=server.createobject("adodb.RecordSet")
aa="select top 3 * from tp where ty='xp' ORDER BY id desc"
rs.open aa,conn,1,3
rs.movelast
%>
newhandtoo 2004-05-06
  • 打赏
  • 举报
回复
aa="select top 3 * ..."
rs.open ...
if not rs.eof then
array=rs.getrows()
end if
if isarray(array) then
for i=0 to ubound(array,2)
if i=ubound(array,2) then
response.write "第三条记录"
end if
next
end if
sunshine5211314 2004-05-06
  • 打赏
  • 举报
回复
aa="select top 3 * from tp where id not in (select top 2 id from tp order by id desc ) where ty='xp' ORDER BY id desc"
sinusoid 2004-05-06
  • 打赏
  • 举报
回复
rs.move 3

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧