以下的代码仅仅是例子,大家如果有需要的话就根据这个例子进行修改使用!
一般来说,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
%>