unforgettable什么意思:ASP程序问题,这个怎么按照 desc 顺序排列 (怎么修改

来源:百度文库 编辑:高考问答 时间:2024/04/30 00:04:44
<!--#include file="conn.asp" -->

<%
proviceId=request.QueryString("proviceId")
MaxPerPage=4 '每页显示的记录数
totalPut=21 '总记录数
pages=11 '总页数
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
'-----------get the total records from table-----
sql="select count(*) from Products where ScategoryID=" & proviceId
rs.open sql,conn,1,1
if not rs.eof then totalPut=rs(0)
rs.close
'-----------get end----------
sql="select * from Products where ScategoryID=" & proviceId
rs.open sql,conn,1,1

if currentPage<>1 then
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
else
currentPage=1
end if
end if
pages=totalPut\MaxPerPage
if MaxPerPage*pages<totalPut then
pages=pages+1
end if
%>

<%
i=0
do while not rs.eof
%>
<head>
<LINK href="../css/css.css" type=text/css rel=stylesheet>

</head>

<table border="0" width="454" cellspacing="1" height="156" background="../images/zpbj.jpg">
<tr>
<td width="100%" valign="top">
<table border="0" width="100%" cellpadding="0" cellspacing="0" height="150">
<tr>
<td width="6%" height="150"></td>
<td width="36%" height="150"><img border="0" src="news/<%=rs("pic")%>" width="157" height="94"><br>
</td>
<td width="59%" height="150" valign="top">
<div align="right">
<table border="0" cellpadding="0" cellspacing="0" width="90%">
<tr>
<td width="97%">
<p align="center"><b><br>
<br>
<font color="#000000"><a href="<%=rs("linkurl")%>" target="_blank"><%=rs("ProductName")%></a></font><br>
<br>
</b></td>
<td width="3%"></td>
</tr>
<tr>
<td width="97%"><%=rs("ProductMemo")%></td>
<td width="3%"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
i=i+1
if (i mod 1)=0 then
response.Write"</tr><tr>"
end if
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
%>
<center>
</table>
</center>

sql="select * from Products where ScategoryID=" & proviceId & "order by 排序列 desc"