排序方式解决“上下主题”问题(三)

显示:(排序)main.asp

--------部分,未经优化处理-------

 1   
 2Const adOpenStatic = 3   
 3Const adLockPessimistic = 2   
 4Set conn = Server.CreateObject("ADODB.Connection")   
 5Set RS = Server.CreateObject("ADODB.Recordset")   
 6DBPath=Server.MapPath("../fpdb/massege.mdb")   
 7conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};dbq="& DBPath   
 8SQLcmd="Select * From MASSEGE Order By A_OrderID Desc"   
 9RS.Open SQLcmd,conn,adOpenStatic,adLockPessimistic   
10page = CLng(Request("txtpage"))   
11RS.PageSize = 30   
12If Page < 1 Then Page = 1   
13If page > RS.PageCount Then page = RS.PageCount   
14RS.AbsolutePage = page   
 1<form action="main.asp" method="get">
 2<table align="center" border="0" cellpadding="0" cellspacing="0">
 3<tr>
 4<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>
 5<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>
 6<td height="1" style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00"><font color="#0000FF">留言笔数:```
 7=RS.RecordCount
 8```</font></td>
 9<td height="1" style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00"><font color="#0000FF">总页数:```
10=RS.PageCount
11```</font></td>
12<td height="1" style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00"><font color="#0000FF">目前页次:```
13=page
14```</font></td>
15<td align="left" height="1" style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00" valign="top"><font color="#0000FF">转到<input name="txtpage" size="2" style="font-size: 8pt; border-style: dotted; border-width: 1" type="text"/>页</font></td>
16<td style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00">
17<font color="#0000FF">   

If page &lt;&gt; 1 Then
Response.Write"<a href="main.asp?txtpage=1">第一页</a>"

1<td style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00">
2<font color="#0000FF">   

Response.Write"<a -="" 1)&"="" href='main.asp?txtpage="&amp;(page'>上一页</a>"

End If
If page &lt;&gt;RS.PageCount Then

1<font color="#0000FF">   

Response.Write"<a +="" 1)&"="" href='main.asp?txtpage="&amp;(page'>下一页</a>"

1<td style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00"><font color="#0000FF">```
2Response.Write"&lt;a href='main.asp?txtpage="&amp;amp;RS.PageCount&amp;amp;"'&gt;最后一页&lt;/a&gt;"   
3End If   
4
5```</font></td>
6<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>
7<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

1<td style="border-left: 1 solid #FFFF00; border-right: 1 solid #FFFF00; border-bottom: 2 solid #FFFF00"><font color="#0000FF">本版斑竹:<a href="mailto:[email protected]">沧海为水</a><img height="15" src="../images/```
2=aaa
3```.gif" width="15"/></font></td>
4</tr>
5</table>
6</form>
1For ipage = 1 To RS.PageSize

.
.
.
(缩进,省略)
face=RS("A_Face")
mmm=gif&""&face&".gif"
%>

1<table align="center" bgcolor="#BEBEDC" border="0" cellspacing="1" width="750">
2<tr>
3<td style="border-bottom: 1 solid #FFFF00">```
4=aaa
  • ``` =Server.HTMLEncode(RS("A_Subject")) ``` ```

    If RS("A_Text")="" Then
    Response.Write"&lt;无内容&gt;"
    End If

     1{ID:```
     2=RS("A_ID")
     3```}【```
     4=RS("A_Name")
     5```ID:```
     6=RS("A_NID")
     7```】&lt;```
     8=RS("A_Time")
     9```&gt;『点击:```
    10=RS("A_Times")
    11```』</li></ul></td>
    12</tr>
    13</table>
    

    <%
    RS.MoveNext
    If RS.EOF Then Exit For
    Next
    RS.Close
    conn.Close

Published At
Categories with Web编程
Tagged with
comments powered by Disqus