不知道为什么不能排序.望指教啊. 内容如下:
动态排序.ASP
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>查询成绩信息表</title>
</head>
<body>
<center>
<h2>读取全部成绩记录</h2>
<%
'OLE-DB 连接数据库代码
Set objConn =Server.Createobject("ADODB.Connection")
Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
DBPath = "Data Source= "& Server.MapPath("score.mdb")
objConn.Open Provider&DBPath
'创建并初始化Recordset对象.
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.ActiveConnection=objConn
objRS.Source="SELECT * FROM Sreport where stid like '010011%'"&_
"and coid='0001'"&_
"order by mark"&request("ordermode")
objRS.Open
%>
<p>排序条件:成绩记录按分数 <a href="动态排序.asp?OrderMode=ASC">升序</a>
<a href="动态排序.asp?OrderMode=DESC">降序</a> 排列
<!--注释:将查询到的数据显示在表格中-->
<table border="1">
<tr>
<th>学号</th>
<th>课程</th>
<th>成绩</th>
<th>备注</th>
</tr>
<%
'注释:读取记录集中所有的成绩记录
Do While Not objRS.EOF
%>
<tr>
<td><%=objRS("stid")%></td>
<td><%=objRS("coid")%></td>
<td><%=objRS("mark")%></td>
<td><%=objRS("note")%></td>
</tr>
<%
objRS.MoveNext
Loop
objRS.Close
set objrs=nothing
objconn.close
set objconn=nothing
%>
</table>
</center>
</body>
</html>