主页 > 编程资料 > C# >
发布时间:2015-09-26 作者:网络 阅读:184次

ASP&Access随机读取某段数据

在网上也搜索了很多,分享下我的方法...

以下是源代码:
Randomize(Timer())
SQL = "SELECT TOP 100 ID FROM table1 ORDER BY Rnd(-(ID + " & Int((10000 * Rnd) + 1) & "))"
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open SQL,Conn,1,1
If Not RS.EOF Then
       RS.MoveFirst
       For I = 1 To RS.RecordCount
              Response.Write RS(0) & "
"
              RS.MoveNext
       Next
End If
RS.Close
Set RS = Nothing

关键字词: