楼主如果数据理有100道题的话,上面的
x=Int(rnd*15)+1就改为x=Int(rnd*100)+1
-------------------------------------------
具体思路代码如下:
dim a(10)
yes=0
randomize
for i=1 to 10
do
x=Int(rnd*100)+1
yes=0
for j=1 to i-1
if x=a(j) then
yes=1
exit for
end if
next
loop while yes=1
a(i)=x '得到了一个随机数(保证每次不相同)
sql="select * from 表 where ID(题目)='"& x &"'"
%>
<table><tr><td>....显示题目的HTML代码</td></tr></table>
<%
next
%>
楼主可以先产生一个不相同的随机数(具体看楼主看要求多少个)
然后利用循环,到数据库里去取数据:
下面是随机产生不相同10个数字的代码:
<%
dim a(10)
yes=0
randomize
for i=1 to 10
do
x=Int(rnd*15)+1
yes=0
for j=1 to i-1
if x=a(j) then
yes=1
exit for
end if
next
loop while yes=1
a(i)=x
response.write a(i)&"<br>"
next
%>