asp如何对access数据库的数据进行分页
2013-04-12 15:17
169 查看
<% Mytype = request("newstype") 'response.write Mytype exec = "select * from newscenter where newstype='" & Mytype & "'order by newstime desc" 'response.write exec set rs = server.createobject("adodb.recordset") rs.open exec,conn,1,1 infonum = rs.RecordCount pageSize = 10 rs.PageSize = pageSize pagecount = rs.PageCount page = int(request.QueryString("page")) 'response.write pagecount 'response.write page if page <= 0 then page = 1 if page > pagecount then page = pagecount if request.QueryString("page") = "" then page = 1 'response.write page 'response.end rs.AbsolutePage = page count = 1 %>
<% for i=1 to pageSize if not rs.eof and count <= rs.PageSize then %> <tr> <%=rs("newstitle")%> <%=FormatDateTime(Rs("newstime"),vbShortDate)%> </tr> <% count = count + 1 rs.movenext end if next rs.close set rs = nothing %>
分页文章内容
<%if pagecount = 1 then%> << 起始页 < 上一页 > 下一页 >> 最终页 <%end if%> <%if pagecount > 1 and page = 1 then%> << 起始页 < 上一页 <a href="news_list.asp?newstype=<%=Mytype%>&page=<%=page+1%>">> 下一页</a> <a href="news_list.asp?newstype=<%=Mytype%>&page=<%=pagecount%>">>> 最终页</a> <%end if%> <%if pagecount > 1 and page>1 and page < pagecount then%> <a href="news_list.asp?newstype=<%=Mytype%>&page=1"><< 起始页</a> <a href="news_list.asp?newstype=<%=Mytype%>&page=<%=page-1%>">< 上一页</a> <a href="news_list.asp?newstype=<%=Mytype%>&page=<%=page+1%>">> 下一页</a> <a href="news_list.asp?newstype=<%=Mytype%>&page=<%=pagecount%>">>> 最终页</a> <%end if%> <%if pagecount > 1 and page = pagecount then%> <a href="news_list.asp?newstype=<%=Mytype%>&page=1" target="_self"><< 起始页</a> <a href="news_list.asp?newstype=<%=Mytype%>&page=<%=page-1%>">< 上一页</a> > 下一页 >> 最终页 <%end if%>
显示上下页
相关文章推荐
- asp.net中对DataTable数据进行排序、检索、合并、分页、统计
- 润乾V4 报表设计时针对数据每7行进行一次分页,少于7行的补齐如何实现呢?
- asp.net中对DataTable数据进行排序、检索、合并、分页、统计
- asp中如何实现导入客户端Excel文件数据至服务器端Access数据库
- 如何禁止用户直接对TextBox进行数据粘贴?(ASP.NET WEB开发)
- asp.net中对DataTable数据进行排序、检索、合并、分页、统计
- [转]asp.net中对DataTable数据进行排序、检索、合并、分页、统计
- Asp.Net (C#)如何进行Oracle数据库分页(存储过程)
- 在S2SH整合中如何对其多表联合查询出来的数据,进行分页和排序
- ASP.NET GridView 直接进行数据的修改和分页的实现
- ASP.NET Eval如何进行数据绑定
- ASP.NET Eval如何进行数据“.NET研究”绑定
- 如何用ASP对EXCEL表进行写入数据???[转]
- 一起谈.NET技术,ASP.NET Eval如何进行数据绑定
- ASP.NET Eval如何进行数据绑定
- 如何对分库后的数据进行分页查询?
- 教您如何进行SQL数据分页
- 如何使用ASP.NET对ACCESS数据库进行增删改查操作(基本型)
- ASP.NET中对DataList控件进行数据绑定并分页
- ASP.NET中对DataList控件进行数据绑定并分页