以下的代碼僅僅是例子,大家如果有需要的話就根據這個例子進行修改使用!
一般來說,ACC是足夠應付站點的,除非是你非常大型,不然ACC還是非常不錯的!
程序代碼
<%
dim sjtop,Aa,le
'准備讀取多少記錄
le=5
Set sjtop = Server.CreateObject("ADODB.Recordset")
sjtop.open "select * from 庫名",conn,1,3
Aa = sjtop.recordcount-le
sjtop.move(randsub(Aa))
if sjtop.eof then
%>
不存在數據
<%end if%>
<%
for i = 1 to le %>
內容
<%
sjtop.movenext
next
sjtop.close
'取隨機數
Function Randsub(total)
Randomize
Randsub = int((total-1+1)*rnd+1)
end Function
%>