| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 663 人关注过本帖
标题:这分页的代码错在哪呢?弄了一天还是不知道啥原因!请高手帮个忙!~~先谢谢 ...
只看楼主 加入收藏
qjw9004
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2011-1-27
结帖率:47.37%
收藏
已结贴  问题点数:20 回复次数:10 
这分页的代码错在哪呢?弄了一天还是不知道啥原因!请高手帮个忙!~~先谢谢了~
<!-- #include file="conn.asp" -->
<%
set rs_config=conn.execute("select * from config")
biaoji=rs_config("biaoji")
%>
<%
set rs_htyj=conn.execute("select * from htyj where htbh='"+request.querystring("htbh")+"'")
rs_htyj.open sql_htyj,conn,1,1
set rs_htsx=conn.execute("select * from htsx where htbh='"+request.querystring("htbh")+"'")
rs_htsx.open sql_htsx,conn,1,1
set rs_fkmx=conn.execute("select * from fkmx where htbh='"+request.querystring("htbh")+"'")
rs_fkmx.open sql_c,conn,1,1
rs_fkmx.pagesize=10
if request("p_fkmx")<>"" then
  ep_fkmx=cint(request("p_fkmx"))
   if ep_fkmx<1 then ep_fkmx=1
   if ep_fkmx>rs_fkmx.pagecount then ep_fkmx=rs_fkmx.pagecount
else
ep_fkmx=1
end if
rs_fkmx.absolutepage=ep_fkmx
%>


<%
   bm = session("bm")
   username = session("username")
   password = session("password")
    set rs = server.createobject("adodb.recordset")
    sql ="select * from user where bm='"&bm&"' and username='"&username&"' and password='"&password&"'"
    rs.open sql,conn,1,1
    if rs.eof then  '如果没有数据
        call close_rs '关闭表
        call close_conn '关闭数据库
        response.redirect "../error.asp"
        response.end
        else
    end if
%>

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>无标题文档</title>
<style type="text/css">
td        { font-size: 10pt; line-height: 12pt}
a:link    {color: #0080FF; text-decoration: none }
a:visited {color: #0080FF; text-decoration: none }
a:hover   {color: #ee9c00; text-decoration: underline }
.style1 {color: #000000}
</style>

</head>

<body topmargin="15">
<center>
<div style="width:756px;height:120px;border:1px solid #000000;">
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" class="12">
  <form name="form1" method="post" action="save.asp" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG');return document.MM_returnValue">
    <tr bgcolor="#666666">
      <td height="25" colspan="2"><div align="center">
          <strong><font color="#FFFFFF">添 加 合 同 原 件 (</font><font color="#FF0000">*</font><font color="#FFFFFF">为必填项)</font></strong></div></td>
    </tr>
    <tr bgcolor="#f1f3f5">
      <td width="20%" height="20" align="right">合同编号+合同相对方:</td>
      <td width="50%" align="left"><input name="myname" type="text" value="<%=request.querystring("htbh")%>_<%=request.querystring("gys")%>" readonly="readonly" class="input" id="myname" size="40">
      页码标记:
        <input name="ym" type="text" id="ym" size="2">        
        <font color="#FF0000">*</font>两位页码<input name="htbh" type="hidden" id="htbh" value="<%=request.querystring("htbh")%>" size=""><input name="gys" type="hidden" id="gys" value="<%=request.querystring("gys")%>" size=""></td>
    </tr>
    <tr bgcolor="#f1f3f5">
      <td width="20%" height="20" align="right">扫描件上传:</td>
      <td align="left"><input name="file0" type="file" class="input" id="file0" size="40">
        <font color="#FF0000">*</font> <input type="button" name="Submit22" value="预览" style="width=70;height=20;font-size=12" onClick="view0()">
          <font color="#3333FF"><br>(上传产品放<strong>小</strong>图,建议<font color="#FF0000">120*120px</font>)</br></font>
      </td></tr>
    <tr bgcolor="#f1f3f5">
      <td height="20" align="right">扫描件说明:
</td>
      <td height="20" align="left"><input name="shuoming" type="text" id="shuoming" size="70"></td>
    </tr>
    <tr bgcolor="#f1f3f5">
      <td height="26" colspan="2"><div align="center">
          <input name="filepath" type="hidden" value="pic">
          <input name="Submit" type="submit" class="button" value="确 定 提 交" style="width=130px;height=30px;font-size=12px">
        </div></td>
    </tr>
  </form>
</table>
</div>
<div style="width:756px;height:1086px;border:1px solid #000000;margin-top:10px">
<table width=99% border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
  <td align="center">
<table border="0" width="90%" cellpadding="0" style="border-collapse: collapse; border: 1px dotted #A4A4FF" bordercolor="#111111" cellspacing="0">
     <!--DWLayoutTable-->           
<form action="ht_sx_do.asp" method="post" name="ht_sx">
      <tr>
        <td height="28" colspan="12" align="center"   type="text"><%=biaoji%></td>
        </tr>
      <tr>
        <td colspan="12" align="center"  type="text">合同摘要记录封面</td>
        </tr>
      <tr>
        <td height="28" colspan="8" align="left" type="text">供 应 商:<%=rs_htsx("gys")%></td>
        <td width="1%" align="left" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td colspan="3" align="left"  type="text">分类性质:<%=rs_htsx("flxz")%> </td>
        </tr>
      <tr>
        <td height="28" colspan="8" align="left"  type="text">合同内容:<%=rs_htsx("htnr")%> </td>
        <td align="left" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td colspan="3" align="left"  type="text">合同编号:<%=rs_htsx("htbh")%></td>
        </tr>
      <tr>
        <td colspan="7" align="left" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td colspan="2" rowspan="2" align="right"  type="text">合同金额:</td>
        <td height="25" colspan="3" align="left"  type="text">合同价:<%=rs_htsx("htj")%></td>
        </tr>
      <tr>
        <td colspan="7" align="left"  type="text">付款期限及条件:</td>
        <td height="28" colspan="3" align="left"  type="text">结算价:<%=rs_htsx("jsj")%> </td>
        </tr>
      <tr>
        <td width="5%" align="center" type="text" >序号</td>
        <td colspan="9" align="center"  type="text">期限及条件</td>
        <td width="1%" align="left" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="15%" align="center" type="text" >金额</td>
      </tr>
      <tr>
        <td height="28"align="right" type="text" >1、</td>
        <td colspan="9" align="left" valign="bottom" type="text"word-break="break-all"><%=rs_htsx("fkje01")%></td>
        <td align="left" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je01")%></td>
      </tr>
      <tr>
        <td height="28" align="right" type="text" >2、</td>
        <td colspan="9" align="left" valign="bottom" type="text"><%=rs_htsx("fkje02")%></td>
        <td align="right" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je02")%></td>
      </tr>
      <tr>
        <td height="28" align="right" type="text" >3、</td>
        <td colspan="9" align="left" valign="bottom" type="text"><%=rs_htsx("fkje03")%></td>
        <td align="left" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je03")%></td>
      </tr>
      <tr>
        <td height="28" align="right" type="text" >4、</td>
        <td colspan="9" align="left" valign="bottom" type="text"><%=rs_htsx("fkje04")%></td>
        <td align="left" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je04")%></td>
      </tr>
      <tr>
        <td height="28" align="right" type="text" >5、</td>
        <td colspan="9" align="left" valign="bottom" type="text"><%=rs_htsx("fkje05")%> </td>
        <td align="right" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je05")%></td>
      </tr>
      <tr>
        <td height="28" align="right"type="text" >6、</td>
        <td colspan="9" align="left" valign="bottom" type="text"><%=rs_htsx("fkje06")%></td>
        <td align="right"type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je06")%></td>
      </tr>
      <tr>
        <td height="28" align="right" type="text" >7、</td>
        <td colspan="9" align="left" valign="bottom" type="text"><%=rs_htsx("fkje07")%></td>
        <td align="right" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je07")%></td>
      </tr>
      <tr>
        <td height="28" align="right" type="text" >8、</td>
        <td colspan="9" align="left" valign="bottom" type="text"><%=rs_htsx("fkje08")%></td>
        <td align="right" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" type="text" ><%=rs_htsx("jx_je08")%></td>
      </tr>               
      </form>
    </table>  </td>
</tr>
<tr>
<td align="center">
<table border="0" width="90%" table frame="below" cellpadding="0" style="border-collapse: collapse; border: 1px dotted #A4A4FF" cellspacing="0">
     <!--DWLayoutTable-->           
      <tr>
        <td height="19" colspan="4"align="left" type="text" >付款明细</td>
        <td height="19" colspan="9"align="right" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
      <tr>
        <td width="40" height="28"align="center" type="text" >序号</td>
        <td width="7" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="81" align="center"  type="text">付款日期</td>
        <td width="8" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="80" align="center"  type="text">凭证编号</td>
        <td width="8" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="78" align="center"  type="text">对应科目</td>
        <td width="7" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="95" align="center"  type="text">付款金额</td>
        <td width="8" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="104" align="center"  type="text">尚欠金额</td>
        <td width="10" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="143" align="center"  type="text">发票情况</td>
      </tr>
<%
for i=0 to rs_fkmx.pagesize-1
if rs_fkmx.bof or rs_fkmx.eof then exit for
%>
      <tr>
        <td height="28"align="center" valign="bottom" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="center" valign="bottom" type="text" ><%=rs_fkmx("fkrq")%></td>
        <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="center" valign="bottom" type="text"><%=rs_fkmx("pzbh")%></td>
        <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="center" valign="bottom" type="text"><%=rs_fkmx("dykm")%></td>
        <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" valign="bottom" type="text"><%=formatnumber(rs_fkmx("fkje"),2,-1,0,-1)%></td>
        <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="right" valign="bottom" type="text"><%=formatnumber(rs_fkmx("sqje"),2,-1,0,-1)%></td>
        <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td align="center" valign="bottom" type="text"><%=rs_fkmx("fpqk")%></td>
      </tr>
<%
rs_fkmx.movenext()
next
%>
      <tr>
        <td height="25" colspan="13"align="center" valign="bottom" type="text" >
<p align="center">
<a href="ht_mx.asp?htbh=<%=request.querystring("htbh")%>&gys=<%=request.querystring("gys")%>&p_fkmx=<%=ep_fkmx-1%>">前一页</a>
<a href="ht_mx.asp?htbh=<%=request.querystring("htbh")%>&gys=<%=request.querystring("gys")%>&p_fkmx=<%=ep_fkmx+1%>">后一页</a>
</p>
<p align="center">现在是第<%=ep_fkmx%>页一共有<%=rs_fkmx.pagecount%>页</p>
        </tr>
<%
conn.close()
%>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>
搜索更多相关主题的帖子: file 原因 where include 
2011-08-03 21:51
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:5 
是什么错误?说清楚啊!这大段代码怎么看?

----我怎能在别人的苦难面前转过脸去----
2011-08-04 08:05
噶么噶么
Rank: 2
等 级:论坛游民
帖 子:15
专家分:67
注 册:2011-8-3
收藏
得分:5 
把错误代码也帖出来吧
2011-08-04 09:01
qjw9004
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2011-1-27
收藏
得分:0 
无论数据为多少条,按 “首页”“前一页”“后一页 ”“末页”都没有用
及页数为负数“现在是第-1页  共有-1页”

我不知道错在哪,也不知道放那些代码说才让各位高手看明白点,所以就把整代码贴上了!~~

<!-- #include file="conn.asp" -->
 <%                                                                                                                                                                                                                                      
 set rs1=conn.execute("select * from htyj where htbh='"+request.querystring("htbh")+"'")                                                                                                                                                
 rs1.open sql,conn,1,1                                                                                                                                                                                                                  
 set rs2=conn.execute("select * from htsx where htbh='"+request.querystring("htbh")+"'")                                                                                                                                                
 rs2.open sql,conn,1,1
 set rs3=conn.execute("select * from fkmx ")                                                                                                                                                
 rs3.open sql,conn,1,1                                                                                                                                                                                                                  
 rs3.pagesize=10                                                                                                                                                                                                                        
 if request("page")<>"" then                                                                                                                                                                                                            
   epage=cint(request("page"))                                                                                                                                                                                                           
    if epage<1 then epage=1                                                                                                                                                                                                              
    if epage>rs3.pagecount then epage=rs3.pagecount                                                                                                                                                                                      
 else                                                                                                                                                                                                                                    
 epage=1                                                                                                                                                                                                                                 
 end if                                                                                                                                                                                                                                 
 rs.absolutepage=epage
 %>                                                                                                                                                                                                                                      
 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>                                                                                                                                                                                                
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.                                                                                                                                 
 <html>                                                                                                                                                                                                                                 
 <head>                                                                                                                                                                                                                                 
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">                                                                                                                                                                    
 <title><%=request.querystring("htbh")%>_<%=request.querystring("gys")%></title>   
 </head>                                                                                                                                                                                                                                 
 <body topmargin="15">                                                                                                                                                                                                                  
 <center>
 <div style="width:756px;height:1065px;border:1px solid #000000;margin-top:10px">                                                                                                                                                        
 <table width=99% border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                                                                            
 <tr>                                                                                                                                                                                                                                    
   <td align="center">&nbsp; </td>                                                                                                                                                                                                                     
 </tr>                                                                                                                                                                                                                                   
 <tr>                                                                                                                                                                                                                                    
 <td align="center">                                                                                                                                                                                                                     
 <table border="0" width="90%" table frame="below" cellpadding="0" style="border-collapse: collapse; border: 1px dotted #A4A4FF" cellspacing="0">                                                                                       
      <!--DWLayoutTable-->                                                                                                                                                                                                               
<%
for i=0 to rs3.pagesize-1
if rs3.bof or rs3.eof then exit for
%>
       <tr>                                                                                                                                                                                                                              
         <td height="28"align="center" valign="bottom" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                 
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="left" valign="bottom" type="text" ><%=rs3("fkrq")%></td>                                                                                                                                                           
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="center" valign="bottom" type="text"><%=rs3("pzbh")%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="left" valign="bottom" type="text"><%=rs3("dykm")%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="right" valign="bottom" type="text"><%=formatnumber(rs3("fkje"),2,-1,0,-1)%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="right" valign="bottom" type="text"><%=formatnumber(rs3("sqje"),2,-1,0,-1)%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="left" valign="bottom" type="text"><%=rs3("fpqk")%></td>                                                                                                                                                            
       </tr>
<%
rs3.movenext()
next
%>
<tr>                                                                                                                                                                                                                              
<td height="25" colspan="13"align="center" valign="bottom" type="text" >
<p align="center">
<a href="ht_mx.asp">首页</a>&nbsp;
<a href="ht_mx.asp?page=<%=epage-1%>">前一页</a>&nbsp;
<a href="ht_mx.asp?page=<%=epage+1%>">后一页</a>&nbsp;
<a href="ht_mx.asp?page=<%=rs.pagecount%>">末页</a>
</p>
<p align="center">现在是第<%=epage%>页&nbsp;&nbsp;共有<%=rs3.pagecount%>页</p>
 </td>                                                                                                                                                                                                                                   
</tr>                                                                                                                                                                                                                           
</table>
</td>                                                                                                                                                                                                                       
</tr>                                                                                                                                                                                                                                   
</table>                                                                                                                                                                                                                                
</div>                                                                                                                                                                                                                                 
</center>                                                                                                                                                                                                                              
</body>                                                                                                                                                                                                                                 
</html>
2011-08-04 23:13
qjw9004
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2011-1-27
收藏
得分:0 
回复 3楼 噶么噶么
你好!3楼的朋友,我是刚入门,这个问题困惑我很久了,切望有您的帮助!谢谢~
按 “首页”“前一页”“后一页 ”“末页”都没有用
及页数为负数“现在是第-1页  共有-1页”



[ 本帖最后由 qjw9004 于 2011-8-4 23:18 编辑 ]
2011-08-04 23:15
qjw9004
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2011-1-27
收藏
得分:0 
回复 2楼 dzt0001
你好!dzt0001 切望有您的帮助!谢谢~
按 “首页”“前一页”“后一页 ”“末页”都没有用
及页数为负数
如“现在是第-1页  共有-1页”


2011-08-04 23:18
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:5 
程序代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="CONDB.inc"-->
<!--引用数据库连接文件-->
<%
   '声明数据库记录集对象
   Dim rsano
   Dim oWebI
   '创建数据库记录集对象
   Set rsano=Server.CreateObject("ADODB.Recordset")
   '设定数据库记录集游标类型
   rsano.cursortype=3
   '打开记录集对象
   rsano.Open "select * From ANOUCE ORDER BY AnnounceTheDate DESC",con
   '设定每页显示记录数
   rsano.pagesize=25
   '得到请求的页号
   page=clng(request("page"))
   IF request("page")<>"" then
     page=clng(request("page"))
   Else
     page=1
   End IF
   IF page<1 Then page=1
   If page>rsano.pagecount Then page=rsano.pagecount
   rsano.absolutepage=page
%>
<title>网站公告页面</title>
<!--去除超连接下划线样式表和字体大小设定代码-->
<style type="text/css">
<!--
-->
</style>
<STYLE type=text/css>
A {
    TEXT-TRANSFORM: none; TEXT-DECORATION: none
}
UNKNOWN {
    TEXT-DECORATION: underline
}
.style22 {font-size: 12px}
.style16 {font-size: 14px}
</STYLE>
</head>

<BODY>

<table width="294" height="46" border="0" cellspacing="0">
  <tr>
    <td width="338"><div align="center" class="style22">公告标题</div></td>
    <td width="95"><div align="center" class="style22">发布日期</div></td>
  </tr>
  <%
  '定义循环变量
  dim iPage
  For iPage=1 to rsano.Pagesize
   'recno=(page-1)*rsano.pagesize+ipage记录编号计算公式
   Response.Write("<tr>")
     Response.write("<td><span class=style16><a href=announceview.asp?anbh="&rsano.Fields(0).Value&" target=_self>"&rsano.Fields(1).Value&"</a></span></td>")
     Response.Write("<td><span class=style22>"&FormatDateTime(rsano.Fields(4).Value,2)&"</span></td>")
   Response.Write("</tr>")
   rsano.MoveNext
   IF rsano.EOF Then
      Exit For
   End If
  Next
  %>
</table>
<table width="293" border="0">
  <tr>
  <%
  '翻页控制代码
  IF page<>1 Then
    Response.Write("<td><span class=style22><a href=announce.asp?page=1>第一页</a></span></td>")
    Response.Write("<td><span class=style22><a href=announce.asp?page="&(page-1)&">上一页</a></span></td>")
  Else
    Response.Write("<td><span class=style22>第一页</span></td>")
    Response.Write("<td><span class=style22>上一页</span></td>")
  End IF    
  IF page<>rsano.pagecount then
    Response.Write("<td><span class=style22><a href=announce.asp?page=" & (page+1) & ">下一页</a></span></td>")
    Response.Write("<td><span class=style22><a href=announce.asp?page=" & rsano.pagecount & ">最后一页</a></span></td>")
  Else
    Response.Write("<td><span class=style22>下一页</span></td>")
    Response.Write("<td><span class=style22>最后一页</span></td>")  
  End IF
  %>
    <td><span class=style22><%=rsano.pagecount%></span></td>
    <td><span class=style22>当前第<%=page%></span></td>
  </tr>
</table>
<%
rsano.Close
con.Close
Set rsano=Nothing
Set con=Nothing
%>
</body>
</html>

给LZ个ASP最简单分页代码
2011-08-05 00:32
噶么噶么
Rank: 2
等 级:论坛游民
帖 子:15
专家分:67
注 册:2011-8-3
收藏
得分:0 
rs.open sql,conn,1,1
你的sql有值吗??
2011-08-05 10:48
qjw9004
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2011-1-27
收藏
得分:0 
回复 8楼 噶么噶么
rs.open sql,conn,1,1
你的sql有值吗??
我是刚入门的,不知您说的“sql有值吗?”的意思~~~
但都能显示出数据~~
如我设为每页为20条数据是可以显示20条的~~
2011-08-05 18:59
qjw9004
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2011-1-27
收藏
得分:0 
<!-- #include file="conn.asp" -->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<%
 set rs3=conn.execute("select * from fkmx")                                                                                                                                                
 rs3.open sql,conn,1,1  
 rs3.pagesize=10                                                                                                                                                                                                                        
 if request("page")<>"" then                                                                                                                                                                                                            
   epage=cint(request("page"))                                                                                                                                                                                                           
    if epage<1 then epage=1                                                                                                                                                                                                              
    if epage>rs3.pagecount then epage=rs3.pagecount                                                                                                                                                                                      
 else                                                                                                                                                                                                                                    
 epage=1                                                                                                                                                                                                                                 
 end if                                                                                                                                                                                                                                 
 rs3.absolutepage=epage                                                                                                                                                                                                                  
 %>                                                                                                                                                                                                                                      

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

<body>
<table border="0" width="90%" table frame="below" cellpadding="0" style="border-collapse: collapse; border: 1px dotted #A4A4FF" cellspacing="0">                                                                                       
      <!--DWLayoutTable-->                                                                                                                                                                                                               
       <tr>                                                                                                                                                                                                                              
         <td height="19" colspan="4"align="left" type="text" >付款明细</td>                                                                                                                                                              
         <td height="19" colspan="9"align="right" type="text" ></td>                                                                                                                                                                     
       <tr>                                                                                                                                                                                                                              
         <td width="40" height="28"align="center" type="text" >序号</td>                                                                                                                                                                 
         <td width="7" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                                   
         <td width="81" align="center"  type="text">付款日期</td>                                                                                                                                                                        
         <td width="8" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                                   
         <td width="80" align="center"  type="text">凭证编号</td>                                                                                                                                                                        
         <td width="8" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                                   
         <td width="78" align="center"  type="text">对应科目</td>                                                                                                                                                                        
         <td width="7" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                                   
         <td width="95" align="center"  type="text">付款金额</td>                                                                                                                                                                        
         <td width="8" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                                   
         <td width="104" align="center"  type="text">尚欠金额</td>                                                                                                                                                                       
         <td width="10" align="center"  type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                                  
         <td width="143" align="center"  type="text">发票情况</td>                                                                                                                                                                       
       </tr>                                                                                                                                                                                                                             
 <%                                                                                                                                                                                                                                      
 for i=0 to rs3.pagesize-1                                                                                                                                                                                                               
 if rs3.bof or rs3.eof then exit for                                                                                                                                                                                                     
 %>                                                                                                                                                                                                                                      
       <tr>                                                                                                                                                                                                                              
         <td height="28"align="center" valign="bottom" type="text" ><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                 
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="left" valign="bottom" type="text" ><%=rs3("fkrq")%></td>                                                                                                                                                           
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="center" valign="bottom" type="text"><%=rs3("pzbh")%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="left" valign="bottom" type="text"><%=rs3("dykm")%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="right" valign="bottom" type="text"><%=formatnumber(rs3("fkje"),2,-1,0,-1)%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="right" valign="bottom" type="text"><%=formatnumber(rs3("sqje"),2,-1,0,-1)%></td>                                                                                                                                                            
         <td align="right" valign="bottom" type="text"><!--DWLayoutEmptyCell-->&nbsp;</td>                                                                                                                                               
         <td align="left" valign="bottom" type="text"><%=rs3("fpqk")%></td>                                                                                                                                                            
       </tr>                                                                                                                                                                                                                             
 <%                                                                                                                                                                                                                                      
 rs3.movenext()                                                                                                                                                                                                                          
 next                                                                                                                                                                                                                                    
 %>                                                                                                                                                                                                                                      
       <tr>                                                                                                                                                                                                                              
         <td height="25" colspan="13"align="center" valign="bottom" type="text" >                                                                                                                                                        
 <p align="center">                                                                                                                                                                                                                     
 <a href="1.asp?htbh=<%=request.querystring("htbh")%>&gys=<%=request.querystring("gys")%>">首页</a>&nbsp;                                                                                                                                                                                                      
 <a href="1.asp?htbh=<%=request.querystring("htbh")%>&gys=<%=request.querystring("gys")%>&page=<%=epage-1%>">前一页</a>&nbsp;                                                                                                        
 <a href="1.asp?htbh=<%=request.querystring("htbh")%>&gys=<%=request.querystring("gys")%>&page=<%=epage+1%>">后一页</a>&nbsp;                                                                                                        
 <a href="1.asp?htbh=<%=request.querystring("htbh")%>&gys=<%=request.querystring("gys")%>&page=<%=rs.pagecount%>">末页</a>                                                                                                                                                                                    
 </p>                                                                                                                                                                                                                                    
 <p align="center">现在是第<%=epage%>页&nbsp;&nbsp;&nbsp;共<%=rs.pagecount%>页</p>                                                                                                                                                                     
 </td>                                                                                                                                                                                                                                   
</tr>                                                                                                                                                                                                                           
</table>
</body>
</html>
为什么是这样?“现在是第-1页   共页”
2011-08-08 11:06
快速回复:这分页的代码错在哪呢?弄了一天还是不知道啥原因!请高手帮个忙!~~先 ...
数据加载中...
 
   



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

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