我想实现一个功能,例:在A表中的dianji字段记录文章被点击次数。
请教,怎么样可以让这个字段中的数据从大到小取前10排序,谢谢大家。
另外昨天请教的问题,批量添加数据已经搞定,源码拿来给大家。
在A页面中生成批量的INPUT
<td align="left" nowrap>
<% dim movieserver,movieurl,moviejishu,movietype,i,i1
i = 1
movieserver = request.form("movie_seurl")
movieurl = request.form("form_url")
moviejishu = request.form("jishu")
moviegesi = request.form("moviegesi")
if moviejishu <> "" then
for i = i to moviejishu
if i < 10 then
i1 = "0"
i = i1&i
end if
if i < 100 then
i2 = "0"
i = i2&i
end if
%>
<table><tr><td align="left" class="admincss">第<%=i%>
集<%=movieserver%><input name="movieurl2<%=i%>" type="text" class="editbox" id="movieurl2<%=i%>" value="<%=movieurl&i&moviegesi%>" size="50" maxlength="255" /></td>
<% next
end if %>
B页面 把批量的INPUT提交给主表和分集的表
<%
if request.form("moviename") = "" then
response.write ("片名不能为空!!<a href=adddata.asp>返回</a>")
response.end
end if
if request.form("movietitle") = "" then
response.write ("主演不能为空!!<a href=adddata.asp>返回</a>")
response.end
end if
if request.form("moviejibie") = "" then
response.write ("请选择级别!!<a href=adddata.asp>返回</a>")
response.end
end if
if request.form("movietype") = "" then
response.write ("没有选择影片类型!!<a href=adddata.asp>返回</a>")
response.end
end if
if request.form("moviejianjie") = "" then
response.write ("影片简介不能为空!!<a href=adddata.asp>返回</a>")
response.end
end if
%>
<%response.write "处理中...<br>"%>
<% dim rs,sql
set rs = server.CreateObject ("adodb.recordset")
sql = "SELECT * FROM movieling"
rs.open sql,conn,1,3
rs.AddNew
rs("name") = request.form("moviename")
rs("title") = request.form("movietitle")
rs("softlevel") = request.form("moviejibie")
rs("typeid") = request.form("movietype")
rs("where") = request.form("diqu")
rs("movietype")= request.form("moviefenlei")
rs("content") = request.form("moviejianjie")
rs("movieurl") = request.form("movie_seurl")
rs("dianji") = "13"
rs("datetime")= date()
rs.Update
%>
<%response.write "写入主信息成功..."&"<br>"
response.write "正在写分集路径...<br>"%>
<% dim rs1,sql1,moviejishu,i
moviejishu = request.form("jishu")
set rs1 = server.CreateObject ("adodb.recordset")
sql1 = "SELECT * FROM movie_url"
rs1.open sql1,conn,1,3
for i = 1 to moviejishu
rs1.AddNew
if i < 10 then
i1 = "0"
i = i1&i
end if
if i < 100 then
i2 = "0"
i = i2&i
end if
rs1("nameid") = rs("id")
rs1("movieurl") = request.form("movieurl2"&i)
rs1.Update
response.write "写入第"&i&"集<br>"
next
%>
<%
rs.close
rs1.Close
response.write ("已成功添加影片!!<a href=adddata.asp>返回</a>")
%>
[此贴子已经被作者于2006-2-23 3:00:40编辑过]