#32005/7/10 11:50:33
呵呵,今天心情不错。
<%
Dim I
Dim RPP
Dim SQL
Dim objRS
Dim objConn
Dim PageNo
I=1
RPP=13
PageNo=CInt(Request("PageNo"))
SQL="SELECT * FROM mytable ORDER BY orderfield"
Set objRS=Server.CreateObject("ADODB.Recordset")
Set objConn=Server.CreateObject("ADODB.Connection")
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("*.mdb")
objConn.Open strConn
objRS.Open SQL,objConn,1,2,1
objRS.PageSize=RPP
If PageNo<=0 Then PageNo=1
If PageNo>objRS.PageCount Then PageNo=objRS.PageCount
objRS.AbsolutePage=PageNo
Sub ShowPageInfo(tPageCount,cPageNo)
Response.Write "第"&cPageNo&"页[共"&tPageCount&"页]"
End Sub
Sub ShowPageNavi(tPageCount,cPageNo)
If cPageNo<1 Then cPageNo=1
If tPageCount<1 Then tPageCount=1
If cPageNo>tPageCount Then cPageNo=tPageCount
Dim NaviLength
NaviLength=18
Dim I,StartPage,EndPage
StartPage=(cPageNo\NaviLength)*NaviLength+1
If (cPageNo Mod NaviLength)=0 Then StartPage=StartPage-NaviLength
EndPage=StartPage+NaviLength-1
If EndPage>tPageCount Then EndPage=tPageCount
If StartPage>1 Then
Response.Write "<a class=""pageNavi"" href=""?PageNo=" & (cPageNo-NaviLength) & """><<</a> "
Else
Response.Write "<font color=""#CCCCCC""><<</font> "
End If
For I=StartPage To EndPage
If I=cPageNo Then
Response.Write "<b>"&I&"</b>"
Else
Response.Write "<a class=""pageNavi"" href=""?PageNo=" & I & """>" & I & "</a>"
End If
If I<>tPageCount Then Response.Write " "
Next
If EndPage<tPageCount Then
Response.Write " <a class=""pageNavi"" href=""?PageNo=" & (cPageNo+NaviLength) & """>>></a>"
Else
Response.Write " <font color=""#CCCCCC"">>></font> "
End If
End Sub
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>部分獲獎優秀論文</title>
<link href="Asset/content.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="780" height="440" border="0" align="center" cellpadding="0" cellspacing="0" background="Asset/images/bg2.jpg">
<tr>
<td height="10"> </td>
</tr>
<tr>
<td valign="top">
<table width="710" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#333333">
<tr bgcolor="#CCCCCC">
<td colspan="3" align="center" class="bigText"><strong>部分獲獎優秀論文</strong></td>
</tr>
<tr bgcolor="#000000">
<td colspan="3" align="center" height="4"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="30" align="center"><strong>序號</strong></td>
<td width="300" align="center"><strong>作者</strong></td>
<td align="center"><strong>論文</strong></td>
</tr>
<%
If objRS.EOF OR objRS.BOF Then
Else
For I=1 To RPP
%>
<tr bgcolor="#FFFFFF">
<td align="center"><%=(PageNo-1)*RPP+I%></td>
<td><%=Trim(objRS("Author"))%><font color="#999999">[<%=Trim(objRS("HomePlace"))%>]</font></td>
<td><%=Trim(objRS("Title"))%></td>
</tr>
<%
objRS.MoveNext
If objRS.EOF OR objRS.BOF Then Exit For
Next
End If
%>
<tr bgcolor="#FFFFFF">
<td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="100" align="center" bgcolor="#CCCCCC"> <% showPageInfo objRS.PageCount,PageNo %> </td>
<td align="center"> <% showPageNavi objRS.PageCount,PageNo %> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="10"> </td>
</tr>
</table>
</body>
</html>