| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2007 人关注过本帖
标题:asp+access查询结果分页
只看楼主 加入收藏
lukebc
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:3
帖 子:74
专家分:32
注 册:2009-8-18
结帖率:71.43%
收藏
 问题点数:0 回复次数:1 
asp+access查询结果分页
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<html>
<head>
<link rel=stylesheet type=text/css href=asp.css>
</head>
<body>

<table align="center" border="0">
<tr>
<td><!--#include file="top.asp"--></td>
</tr>
</table>
<table align="center" border="0">
<form method="post" action="ckcx.asp"name="form1">
<tr>
  <td colspan="8" align="center" bgcolor="#609B95"><strong>出 库 信 息 查 询</strong></td>
  </tr>
<tr>
    <td width="100"><div align="center">编号</div></td>
    <td width="100"><div align="center">出库编号</div></td>
  <td width="100"><div align="center">材料名称</div></td>
  </tr>
  <tr>
  <td><input name="bh" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
<td><input name="ckbh" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
  <td><input name="clmc" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
  <td><input type="submit" name="ckc" value="查"></td>
  </tr>
  </form>
</table>
<%
if request("ckc")="查" then
if request("bh")<>""then
if cond="" then
cond="编号 like '%" & trim(request("bh")) & "%'"
else
cond = cond & " AND 编号 like '%" & trim(request("bh")) & "%'"
end if
end if
if request("ckbh")<>""then
if cond="" then
cond="出库编号 like '%" & trim(request("ckbh")) & "%'"
else
cond = cond & " AND 出库编号 like '%" & trim(request("ckbh")) & "%'"
end if
end if
if request("clmc")<>"" then
If cond="" Then
cond="材料名称 like '%" & trim(request("clmc")) & "%'"
else
cond = cond & "and 材料名称 like '%" & trim(request("clmc")) & "%'"
end if
end if
if cond<>""then
sql="select * from 出库表 where " & cond & "order by 日期"
else
sql="select * from 出库表 order by 日期"
end if
session("sql")=(sql)
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
response.write "<table border='1' align='center' cellpadding='1' cellspacing='1'>"
response.write "<tr>"
response.write "<th>编号</th> <th>出库编号</th> <th>日期</th> <th>材料名称</th> <th colspan='2'><a href='dc1.asp'>导出查询数据</a></th>"
response.write "</tr>"
%>
   <tr><td colspan="12" class="wzjz">共有记录<%=rs.recordcount%>条</td></tr>
<%
do while not rs.eof
%>
<tr onMouseOver="this.bgColor='#99ccff'" onMouseOut="this.bgColor=''">
<td><input type="text" name="bh" class="xswb" readonly="true" size="12" value=<%=rs("编号")%>></td>
<td><input type="text" name="rkbh" class="xswb" readonly="true" size="10" value=<%=rs("出库编号")%>></td>
<td><input type="text" name="rq" class="xswb" readonly="true" size="10" value=<%=rs("日期")%>></td>
<td><input type="text" name="clmc" class="xswb" readonly="true" size="12" value=<%=rs("材料名称")%>></td>
<td class="wzjz" height="22" width=50><a href="ckxx.asp?id=<%=rs("id")%>" target="_blank">详细</a></td>
<td class="wzjz" height="22" width=50><a href="ckxg.asp?id=<%=rs("id")%>">修改</a></td>
<td class="wzjz" height="22" width=50><a onClick="return confirm('你确定要删除此记录吗?')" href="cksc_q.asp?id=<%=rs("id")%>">删除</a></td>
   </tr>
   <%
rs.MoveNext
loop
rs.Close
   %>
</table>
<% end if %>
<body>
</html>

请哪位高手帮忙在以上代码中加一个带页码跳转历能的查询分页代码(带"1" "2" "3"…… 页码的链接跳转和带页码的下拉菜单跳转) 请在原代码上添加
我在网上查例子,但是改业改去还是不行,我知道这个要传递参数,但是我照做了,还是只显示第一页,后面就空白了,所以希望能在我的源代码上添加,这样比较直观,谢谢
新注册,没有分,望见谅
搜索更多相关主题的帖子: include action border center method 
2015-02-28 20:15
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11772
专家分:43421
注 册:2006-5-13
收藏
得分:0 
分页功能的帖子很多,随便搜索一下就会有很多的例子可供参考。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2015-03-08 16:03
快速回复:asp+access查询结果分页
数据加载中...
 
   



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

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