p.s. 本来想直接用rs.sort来再排序,但脱离连接的rs不能更新,只好放弃自建rs而改用数组
下面的演示是需要数据库同步更新,所以不支持并发操作,纯粹是演示说明
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=1001
下面的演示是需要数据库同步更新,所以不支持并发操作,纯粹是演示说明
引用
sql = " delete from temp1 "
cn.execute(sql)
set rs = server.CreateObject("adodb.recordset")
RS.CursorLocation = 3 '注意游标类型设置
RS.Open "temp1",cn,1,3
for i=0 to ubound(arrMobile) ’遍历投票方式1
arrMiss = split( arrMobile(i),"," )
arrMobile(i) = arrMiss(0)
rs.AddNew
rs("id") = i
rs("netHits") = 0
rs("mobileHits") = arrMiss(0) '读取的信息
rs("totalHits") = 0
next
rs.sort = " mobilehits desc " '排序方式1
rs.movefirst
while not rs.eof
response.Write(rs("mobilehits") & "<br>")
rs.movenext
wend
rs.sort = " netHits desc " '排序方式2
rs.movefirst
while not rs.eof
response.Write(rs("mobilehits") & "<br>")
rs.movenext
wend
rs.close
set rs=nothing
cn.execute(sql)
set rs = server.CreateObject("adodb.recordset")
RS.CursorLocation = 3 '注意游标类型设置
RS.Open "temp1",cn,1,3
for i=0 to ubound(arrMobile) ’遍历投票方式1
arrMiss = split( arrMobile(i),"," )
arrMobile(i) = arrMiss(0)
rs.AddNew
rs("id") = i
rs("netHits") = 0
rs("mobileHits") = arrMiss(0) '读取的信息
rs("totalHits") = 0
next
rs.sort = " mobilehits desc " '排序方式1
rs.movefirst
while not rs.eof
response.Write(rs("mobilehits") & "<br>")
rs.movenext
wend
rs.sort = " netHits desc " '排序方式2
rs.movefirst
while not rs.eof
response.Write(rs("mobilehits") & "<br>")
rs.movenext
wend
rs.close
set rs=nothing
[最后修改由 admin, 于 2009-08-05 10:30:58]

这篇日志没有评论。
此日志不可发表评论。