| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 389 人关注过本帖
标题:排序问题
只看楼主 加入收藏
oclassic
Rank: 1
等 级:新手上路
帖 子:140
专家分:0
注 册:2007-4-18
收藏
 问题点数:0 回复次数:1 
排序问题

不知道为什么不能排序.望指教啊. 内容如下:


动态排序.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>

搜索更多相关主题的帖子: html blank PUBLIC target 
2007-10-31 15:10
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
select ...... order by markasc

缺少空格吧?
2007-10-31 15:20
快速回复:排序问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017950 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved