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) & "<br>"
RS.MoveNext
Next
End If
RS.Close
Set RS = Nothing