标题:[公告]大家把自己写的分页发到这里来,看谁的好,谁的短
只看楼主
稻草人人
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2004-9-11
得分:0 

各位高手也帮我看看吧

<% dim SQL on error resume next set Conn=Server.CreateObject("ADODB.Connection") PS="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="_ & Server.MapPath(" jsj.mdb ") Conn.open PS

%> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=gb2312"> <TITLE>计算机设备一览表</TITLE> <STYLE type="text/css"> BODY{FONT-SIZE:12px} TH{FONT-SIZE:12px} TD{FONT-SIZE:12px} </STYLE>

<% if not isempty(request("page")) and request("page")<>"" then currentPage=cint(request("page")) else currentPage=1 end if MaxPerPage=5'###每页显示条数

if request.servervariables("REQUEST_METHOD")="POST" then else end if set rs = Server.CreateObject("ADODB.Recordset") sql="select * from equ"

rs.Open Sql,conn,3

if not rs.eof then rs.pagesize=MaxPerPage '得到每页数 mpage=rs.pagecount '得到总页数 totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if rs.move (currentPage-1)*MaxPerPage end if %> </head>

<div align="center"><center> <TABLE Border=0 width="100%">

<td colspan=24> <H5 ALIGN=CENTER><font size=4>计算机设备一览表</font></H5>

</table> <table border="1" cellspacing="0" topspacing="0" cellpadding="0" bgcolor="#7AABA6"> <tr> <%

Set Columns=rs.Fields %>

<% For i=0 to Columns.Count-1 Response.Write("<td align=center width=200 height=13>") Response.Write("<font size=1><b>"&Columns(i).name&"</b></font></td>") Next Response.Write("</tr>") ''显示内容 For i=1 to rs.PageSize Response.Write("<tr bgcolor=#99ccff bordercolor=#000066>") For j=0 to Columns.Count-1 Response.Write("<td><font size=1>"&Columns(j)&"</font></td>") Next Response.Write("</tr>") rs.movenext if rs.EOF then exit for Next

%> </td> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bgcolor="#FFE3A5"> <tr> <td width="5" nowrap> </td> <td nowrap>总数:<font color="#ff0000"><%=rs.recordcount%> </font> 每页<%=MaxPerPage%>条 共<%=mpage%>页[<a href="javaScript:history.go(0)">刷新</a>]</td> <td width="70%" nowrap> <p align="center"><% pageno=currentPage %> <%if cint(pageno)>1 then%> <a href="equ.asp?page=1" title="最前页"><%end if%> <font face="Webdings">9</font></a>&nbsp;<%if cint(pageno)>1 then%> <a href="equ.asp?page=<%=pageno-1%>" title="上一页"><%end if%> <font face="Webdings">7</font></a><% pp=cint(pageno)-5 if pp<1 then pp=1 end if for pno=pp to mpage p=p+1 if pno*1=cint(pageno)*1 then %> &nbsp;<font color="#FF0000">[<%=pno%> ]</font><%else%> &nbsp;<a href="equ.asp?page=<%=pno%>">[<%=pno%> ]</a><%end if%> <% if p>=11 then exit for next%> &nbsp;<%if cint(pageno)< mpage then%> <a href="equ.asp?page=<%=pageno+1%>" title="下一页"><%end if%> <font face="Webdings">8</font></a>&nbsp;<%if cint(pageno)< mpage then%> <a href="equ.asp?page=<%=mpage%>" title="最后页"><%end if%> <font face="Webdings">:</font></a></p> </td> <td width="1%" nowrap> <table cellpadding="0" cellspacing="0"> <form method="POST" action="equ.asp"> <tr> <td nowrap>到<input name="page" size="2" style="border: 1px solid #000000">页</td> <td vAlign="bottom"><input align="center" name="Submit2" src="goto.gif" type="image" value="Submit"></td> </tr> </form> </table> </td> </tr> </table> <% rs.close set rs=nothing conn.close set conn=nothing%>

[此贴子已经被作者于2004-09-11 15:02:41编辑过]

2004-09-11 15:01
稻草人人
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2004-9-11
得分:0 
请教 我怎么才可以使用版主编写的类呢?
2004-09-11 15:11



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-2816-1-1.html




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

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