desc修改为asc数据显示的顺序没有变?
<!--#include file="conn.asp"--><%
MaxPerPage=500
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim typename
typename=""
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
dim rstype
dim typesql
dim typeid,typename1
if not isEmpty(request("typeid")) then
typeid=request("typeid")
else
typeid=0
end if
%>
<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=GB2312" http-equiv=Content-Type><LINK
href="font.css" rel=stylesheet type=text/css>
<META content="Microsoft FrontPage 6.0" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 text=#000000 topMargin=0>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD
style="PADDING-BOTTOM: 15px; PADDING-LEFT: 15px; PADDING-RIGHT: 15px; PADDING-TOP: 15px">
<%
if request("userid123")="" then
sql="select * from DS2002 order by id desc" '把前面的desc修改为asc数据显示的顺序没有变。想把数据变为倒序怎么办?
else
sql="select * from DS2002 where DS2002Aok='"&request("userid123")&"'"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>你查的这个数据不存在</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"0123.asp"
showContent
showpage totalput,MaxPerPage,"0123.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"0123.asp"
showContent
showpage totalput,MaxPerPage,"0123.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"0123.asp"
showContent
showpage totalput,MaxPerPage,"0123.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<%=rs("字段1")%>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align=""center""><form method=Post action="&filename&"?typeid="&typeid&">"
if CurrentPage<2 then
response.write "<font color='#000080'>首页 上一页</font> "
else
response.write "<a href="&filename&"?page=1&typeid="&typeid&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font
color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<font color=red><b>"&totalnumber&"</b></font>个
<b>"&maxperpage&"</b>个/每页</font> "
response.write " <font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallInput
value="¤tpage&">"
response.write " <input class=buttonface type='submit' value='Goto' name='cndok'></span></p></form></p>"
end function
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</BODY></HTML>
0123.rar
(1.92 KB)