asp 读取记录 从指定第几条读到几条 方法
2015-10-28 16:51
801 查看
for i = 1 to rs.recordcount
if i>5 then
end if
if i<9 and i>4 then
end if
rs.movenext
if rs.eof then exit for
next
例子:
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
set adoRs=server.CreateObject("adodb.recordset")
sql = "select * from db_channel where ParentID = 12 "
adoRs.open sql,conn,1,3
for i = 1 to adoRs.recordcount
if i>4 and i<9 then
%>
<tr>
<td height="27" class="title" >·<a href="/page/default.asp?pageID=<%=Trim(adoRs("pageID"))%>" class="title" style="color:#ffffff; font-weight:bold" title="<%=adoRs("pagename")%>">
<%
if len(adoRs("pagename")) >15 then
response.Write(left(adoRs("pagename"),14)&"...")
else
response.Write(adoRs("pagename"))
end if
%>
</a></td>
</tr>
<%
end if
adoRs.movenext
if adoRs.eof then exit for
next
adoRs.close
%>
</table>
其中 创建的数据表必须打开
(1)、
sql = "select * from db_channel where ParentID = 12 "
Set adoRs = conn.execute(sql)
(2)、第2种打开了
set adoRs=server.CreateObject("adodb.recordset")
sql = "select * from db_channel where ParentID = 12 "
adoRs.open sql,conn,1,3
if i>5 then
end if
if i<9 and i>4 then
end if
rs.movenext
if rs.eof then exit for
next
例子:
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
set adoRs=server.CreateObject("adodb.recordset")
sql = "select * from db_channel where ParentID = 12 "
adoRs.open sql,conn,1,3
for i = 1 to adoRs.recordcount
if i>4 and i<9 then
%>
<tr>
<td height="27" class="title" >·<a href="/page/default.asp?pageID=<%=Trim(adoRs("pageID"))%>" class="title" style="color:#ffffff; font-weight:bold" title="<%=adoRs("pagename")%>">
<%
if len(adoRs("pagename")) >15 then
response.Write(left(adoRs("pagename"),14)&"...")
else
response.Write(adoRs("pagename"))
end if
%>
</a></td>
</tr>
<%
end if
adoRs.movenext
if adoRs.eof then exit for
next
adoRs.close
%>
</table>
其中 创建的数据表必须打开
(1)、
sql = "select * from db_channel where ParentID = 12 "
Set adoRs = conn.execute(sql)
(2)、第2种打开了
set adoRs=server.CreateObject("adodb.recordset")
sql = "select * from db_channel where ParentID = 12 "
adoRs.open sql,conn,1,3
相关文章推荐
- asp 不支持Response.CharSet的时候用下面转码
- ASP连接ACCESS操作方法技巧
- asp遍历所有服务器变量
- 设置ASP页的Session过期时间的问题
- ASP实现不存在的网页就自动发送邮件(jmail组件发送)
- ASP接收Ajax 在POST方式下发送的escape编码中的个别乱码
- 熟练掌握ASP分页技术
- ASP的时间处理函数
- ASP中处理UTF-8格式的文件
- asp字符串函数及实例
- asp常用正则表达式大全
- ASP错误提示大全
- asp网页提升网页速度方法5则
- ASP使用正则表达式获得代码中第一张图片地址
- ASP脚本语言的19个基本技巧应用
- asp.net遍历页面中所有TextBox,并赋值为String.Empty的方法
- ASP.NET将Session保存到数据库中
- ASP.NET运行机制原理
- asp.net中对amCharts(.net版)图形报表的使用
- ASP实现加法验证码