我的人生路  
          日歷
          <2005年7月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456
          統計
          • 隨筆 - 74
          • 文章 - 57
          • 評論 - 7
          • 引用 - 0

          導航

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          顏色

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

           

          <%
          ' 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
          %>



          歡迎大家訪問我的個人網站 萌萌的IT人
          posted on 2005-07-07 14:34 一天一點愛戀 閱讀(198) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
           
          Copyright © 一天一點愛戀 Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 凤凰县| 五寨县| 内乡县| 渝北区| 上高县| 萨迦县| 缙云县| 乐都县| 定远县| 上饶县| 日喀则市| 阜南县| 定陶县| 双峰县| 文山县| 福贡县| 安塞县| 江油市| 凤山县| 乡城县| 平和县| 乌拉特前旗| 博罗县| 溧阳市| 青龙| 广宗县| 延长县| 永定县| 邢台县| 桃江县| 汾阳市| 工布江达县| 保康县| 贵德县| 开鲁县| 南康市| 肥城市| 临沂市| 乐陵市| 罗甸县| 乌鲁木齐县|