| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 541 人关注过本帖
标题:求助:ASp中记录按列显示并分页程序
只看楼主 加入收藏
飘落天涯
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2007-11-5
收藏
 问题点数:0 回复次数:0 
求助:ASp中记录按列显示并分页程序
记录按列显示,并分页,怎么做啊?
<%
 set conn=server.CreateObject("adodb.connection")
 conn.connectionstring="dbq="&server.MapPath("../test.mdb")&";driver={Microsoft Access Driver (*.mdb)}"
 conn.open

%>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%set rs=server.CreateObject("adodb.recordset")
sql="select * from carinfo2"
rs.open sql,conn,3,2
dim arr()
redim arr(rs.fields.count)
   
 if not (rs.eof and rs.bof) then
             dim page_no
              if request.QueryString("page_no")="" or request.QueryString("page_no")=0 then
                   page_no=1
              else
                   page_no=cint(request.QueryString("page_no"))
             end if
             if page_no>rs.pagecount then page_no=rs.pagecount
                rs.pagesize=4
                rs.absolutepage=page_no
               dim j,k
               j=rs.pagesize
               k=rs.pagesize
              
%>
<table border="1">

<%
  For   i=0   to   rs.fields.count-4
  
  response.Write "<tr>"
    for j=1 to rs.pagesize
    
          str=rs(i)
        
                
        
%>
<td align="center"><%=str%></td>


<%
    rs.movenext
    
    next%></tr>
<%
  rs.movefirst
  Next%>
<% response.Write "<tr>"
   
    for j=1 to rs.pagesize
          
          str=rs(rs.fields.count-3)
        
    %>
<td align="center"><img name="" src="<%=str%>" width="150" height="80" alt=""></td>


<%
rs.movenext

next%></tr>
<%

else
   response.Write("<p><center><font color='CC0000'>尚没有案例!!</font></center>")
 
end if

%>

</table>
 <table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="20" align="center" valign="bottom">
              <span class="STYLE1">
              <%
                  if request.QueryString("page_no")="" or request.QueryString("page_no")=0 then
                   page_no=1
              else
                   page_no=cint(request.QueryString("page_no"))
             end if
             %>
             <a href="anlie.asp?page_no=1" class="news">首页</a>
            
             <%
          
            if page_no=1 then
              'else%><a href="anlie.asp?page_no=<%=1%>" class="news">上一页</a>
              <%else%>
              
              <a href="anlie.asp?page_no=<%=page_no-1%>" class="news">上一页</a>
              <%end if%>
             <%if page_no>=rs.pagecount then
             page_no=rs.pagecount%>
              <a href="anlie.asp?page_no=<%=page_no%>" class="news">下一页</a>
              <%else%>
              <a href="anlie.asp?page_no=<%=page_no+1%>" class="news">下一页</a>
             <%end if%>
              <a href="anlie.asp?page_no=<%=rs.pagecount%>" class="news">尾页</a>
            
              
              <span class="STYLE2">当前<%=page_no%>页/共<%=rs.pagecount%>页</span></span></td>
              <%
      
              %>
            
              
        </tr>
      </table>
</body>
</html>
实现了按列显示,但是分页不成功啊
搜索更多相关主题的帖子: quot Microsoft ASp conn 
2008-04-19 14:19
快速回复:求助:ASp中记录按列显示并分页程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.090601 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved