日期:2014-05-17  浏览次数:21099 次

分页啊,分页。当前页可以显示,但是点击“上一页”“下一页”,时,就为空了

主要代码如下:

<!--#include   file=database/conn.asp-->
<!--#include   file=connfig.asp-->
<!--#include   file=inc/yan.asp-->

<%  
set   rs=server.createobject( "adodb.recordset ")
  if   session( "admin_name ")= "Admin "   or   session( "admin_name ")= "admin "   then  
sql= "select   *   from   dailyreport   where   Tdate= ' "&request( "sdate ")& " '   order   by   date   desc "
end   if
  if   session( "admin_name ")= "Jy "   or   session( "admin_name ")= "jy "   then  
sql= "select   *   from   dailyreport   where   username   in   (select   username   from   users   where   name   in   (select   name   from   renshi   where   bumen= '軟體課 '))   and   Tdate= ' "&request( "sdate ")& " '   order   by   date   desc "
end   if

rs.open   sql,conn,1,1

%>

。。。。。。。

<body>
<table   width= "585 "   height= "175 "   border= "0 "   align= "center "   cellspacing= "1 "   bgcolor= "#336699 "   style= "table-layout:fixed;word-break:break-all ">
    <tr   bgcolor= "#FF9900 ">
        <td   height= "77 "   colspan= "6 "> <div   align= "center "   class= "style1   style4 "> 工作日報表 </div> </td>
    </tr>     <tr>
        <td   width= "15% "   height= "33 "   background= "images/tile_sub.gif "> <div   align= "center "   class= "style3 "> 日期 </div> </td>
        <td   width= "15% "   background= "images/tile_sub.gif "> <div   align= "center "   class= "style3 "> 員工姓名 </div> </td>
        <td   width= "40% "   background= "images/tile_sub.gif "> <div   align= "center "   class= "style3 "> 工作內容 </div> </td>
        <td   width= "14% "   background= "images/tile_sub.gif "> <div   align= "center "   class= "style3 "> 離開時間 </div>            
        <div   align= "center "   class= "style3 "> </div> </td>
        <td   width= "16% "   colspan= "2 "   background= "images/tile_sub.gif "> <div   align= "center "   class= "style3 "> 管理 </div> </td>
    </tr>
<%
if   not   rs.eof   then
zong=rs.recordcount
shownum=2
rs.pagesize=shownum
maxpage=rs.pagecount
requestpage=clng(request( "p "))
if   requestpage= " "   or   requestpage=0   then
requestpage=1