最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp下實(shí)現(xiàn)記錄集內(nèi)隨機(jī)取記錄的代碼

 更新時(shí)間:2007年11月24日 22:09:07   作者:  
記錄集內(nèi)隨機(jī)取記錄的代碼

<% 
' Moving to random record - Steven Jones' Extension
If Not(記錄集名稱.bof and 記錄集名稱.eof) Then
' reset the cursor to the beginning
If (記錄集名稱.CursorType > 0) Then
記錄集名稱.MoveFirst
Else
記錄集名稱.Requery
End If

記錄集名稱_totalrn = -1
記錄集名稱_totalrn = 記錄集名稱.RecordCount ' ony works on some recordsets, but much faster
If (記錄集名稱_totalrn = -1) Then ' and if it didn't work, we still have to count the records.

' count the total records by iterating through the recordset
記錄集名稱_totalrn=0
While (Not 記錄集名稱.EOF)
記錄集名稱_totalrn = 記錄集名稱_totalrn + 1
記錄集名稱.MoveNext
Wend

' reset the cursor to the beginning
If (記錄集名稱.CursorType > 0) Then
記錄集名稱.MoveFirst
Else
記錄集名稱.Requery
End If

End If

' now do final adjustments, and move to the random record 
記錄集名稱_totalrn = 記錄集名稱_totalrn - 1
If 記錄集名稱_totalrn > 0 Then
Randomize
記錄集名稱.Move Int((記錄集名稱_totalrn + 1) * Rnd)
End If 
End If
' all done; you should always check for an empty recordset before displaying data
%> 

  

相關(guān)文章

最新評(píng)論

南岸区| 屏边| 晴隆县| 万安县| 乌恰县| 茂名市| 青龙| 澄城县| 海城市| 清河县| 尤溪县| 萝北县| 大庆市| 鄯善县| 马尔康县| 金阳县| 涟源市| 双鸭山市| 凤城市| 阿合奇县| 启东市| 新晃| 孝昌县| 尚志市| 八宿县| 建平县| 邛崃市| 阜平县| 新营市| 平阴县| 米脂县| 南汇区| 阿坝县| 客服| 红安县| 叶城县| 常山县| 大竹县| 达尔| 磐安县| 浠水县|