显示:(排序)main.asp
——–部分,未经优化处理——-
<%
const adopenstatic = 3
const adlockpessimistic = 2
set conn = server.createobject("adodb.connection")
set rs = server.createobject("adodb.recordset")
dbpath=server.mappath("../fpdb/massege.mdb")
conn.open "driver={microsoft access driver (*.mdb)};dbq="& dbpath
sqlcmd="select * from massege order by a_orderid desc"
rs.open sqlcmd,conn,adopenstatic,adlockpessimistic
page = clng(request("txtpage"))
rs.pagesize = 30
if page < 1 then page = 1
if page > rs.pagecount then page = rs.pagecount
rs.absolutepage = page
%>
<form action="main.asp" method="get">
<table align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><a href="speak.asp" target="rbottom"><font color="#0000ff">发言</font></a></td>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><a href="main.asp"><font color="#0000ff">刷新</font></a></td>
<td height="1" style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><font color="#0000ff">留言笔数:<%=rs.recordcount%></font></td>
<td height="1" style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><font color="#0000ff">总页数:<%=rs.pagecount%></font></td>
<td height="1" style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><font color="#0000ff">目前页次:<%=page%></font></td>
<td valign="top" align="left" height="1" style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><font color="#0000ff">转到<input type="text" name="txtpage" size="2" style="font-size: 8pt; border-style: dotted; border-width: 1">页</font></td>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00">
<font color="#0000ff">
<%
if page <> 1 then
response.write"<a href=main.asp?txtpage=1>第一页</a>"%></font></td>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00">
<font color="#0000ff">
<%response.write"<a href=main.asp?txtpage="&(page – 1)&">上一页</a>"%></font></td>
<%
end if
if page <>rs.pagecount then%><td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00">
<font color="#0000ff">
<%response.write"<a href=main.asp?txtpage="&(page + 1)&">下一页</a>" %></font></td>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><font color="#0000ff"><%response.write"<a href=main.asp?txtpage="&rs.pagecount&">最后一页</a>"
end if
%></font></td>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><a href="pob_massege.asp"><font color="#0000ff">精华</font></a></td>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><a href="baoqian.htm"><font color="#0000ff">检索</font></a></td>
<%
if application("ukingliu")="kingliu" then
aaa="on"
else
aaa="off"
end if
%>
<td style="border-left: 1 solid #ffff00; border-right: 1 solid #ffff00; border-bottom: 2 solid #ffff00"><font color="#0000ff">本版斑竹:<a href="mailto:kingliuzk@chinaren.com">沧海为水</a><img src="../images/<%=aaa%>.gif" width="15" height="15"></font></td>
</tr>
</table>
</form>
<%for ipage = 1 to rs.pagesize%>
.
.
.
(缩进,省略)
face=rs("a_face")
mmm=gif&""&face&".gif"
%>
<table align="center" border="0" cellspacing="1" width="750" bgcolor="#bebedc">
<tr>
<td style="border-bottom: 1 solid #ffff00"><%=aaa%>
<ul>
<li><img src="../images/<%=mmm%>"><a href="massege.asp?txtid=<%=rs("a_id")%>" target="rbottom"><%=server.htmlencode(rs("a_subject"))%></a>
<%
if rs("a_text")="" then
response.write"<无内容>"
end if
%>
{id:<%=rs("a_id")%>}【<%=rs("a_name")%>id:<%=rs("a_nid")%>】<<%=rs("a_time")%>>『点击:<%=rs("a_times")%>』</td>
</tr>
</table>
<%
rs.movenext
if rs.eof then exit for
next
rs.close
conn.close
