最新国产好看的视频,伊人天堂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)論

旬邑县| 芦山县| 普宁市| 含山县| 陆丰市| 营山县| 乐至县| 韶山市| 泸定县| 大渡口区| 图片| 中牟县| 清新县| 舞阳县| 开平市| 泰安市| 凭祥市| 马边| 塘沽区| 彭阳县| 黄梅县| 丹阳市| 克什克腾旗| 镇远县| 扎赉特旗| 靖远县| 宕昌县| 夏邑县| 敦煌市| 鲜城| 奉化市| 香河县| 芦溪县| 墨玉县| 香河县| 靖江市| 兖州市| 黑龙江省| 龙南县| 金溪县| 莱州市|