【求助】如何定义只调用数据库排行榜的前几名
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="200" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#C0C0C0" id="AutoNumber1">
<%set rs8=server.CreateObject("ADODB.RecordSet")
sql8="select * from "& db_Dep_Table &" where depnumber>=0 order by depnumber desc"
rs8.open sql8,Conn,1,1
if not rs8.EOF then
%>
<tr align="center" class="TDtop1">
<td width="16%" height="25" >排名</td>
<td width="53%" >所属部门</td>
<td width="31%" >投稿</td>
</tr>
<%
i=1
while not rs8.EOF
%>
<tr>
<td width="16%" align="center" bgcolor="#FFFFFF"><%=i%></td>
<td width="53%" height="25" align="center" bgcolor="#FFFFFF"><%=rs8("deptype")%></td>
<td width="31%" bgcolor="#FFFFFF" align="center"><%=rs8("depnumber")%></td>
</tr>
<%rs8.MoveNext
i=i+1
wend
end if
rs8.close
set rs8=nothing
%>
</table>
</body>
</html>
[ 本帖最后由 liujia0919 于 2011-3-23 14:15 编辑 ]