Problemer med random og cache
Har følgende kode der gerne skulle kunne generere en ny side hver gang jeg refresher siden.... Det virker bare ikke. Er der nogen der kan fortælle mig hvorfor?Siden kan testes her:
http://www.autonorden-it.dk/kort.asp
og her er selve koden:
<%
response.buffer=true
response.expires=-1
response.expiresabsolute= now() - 100
response.addheader "pragma", "no-cache"
response.addheader "cache-control", "private"
response.CacheControl = "no-cache"
%>
<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<meta http-equiv="expires" content="fri, jun 12 1981 08:20:00 gmt">
<title></title>
<style>
td { font-size: 10 px }
</style>
</head>
<body>
<font face=arial>
<center>
<%
set conn = server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)}; dbq=" & server.mappath("data.mdb")
sqlstmt = "Select k1 from hands order by rnd(id)"
sqlstmt1 = "Select k2 from hands order by rnd(id)"
sqlstmt2 = "Select k3 from hands order by rnd(id)"
sqlstmt3 = "Select k4 from hands order by rnd(id)"
sqlstmt4 = "Select k5 from hands order by rnd(id)"
sqlstmt5 = "Select k6 from hands order by rnd(id)"
conn.Execute (sqlstmt)
conn.Execute (sqlstmt1)
conn.Execute (sqlstmt2)
conn.Execute (sqlstmt3)
conn.Execute (sqlstmt4)
conn.Execute (sqlstmt5)
set rs = conn.execute(sqlstmt)
set rs1 = conn.execute(sqlstmt1)
set rs2 = conn.execute(sqlstmt2)
set rs3 = conn.execute(sqlstmt3)
set rs4 = conn.execute(sqlstmt4)
set rs5 = conn.execute(sqlstmt5)
a = 1
b = 1
c = 1
d = 1
e = 1
f = 1
%>
<table width=720 cellpadding=2 cellspacing=0 border=1 bordercolor=black>
<tr>
<td colspan=3 width=120> </td>
<td colspan=3 width=120> </td>
<td colspan=3 width=120> </td>
<td colspan=3 width=120> </td>
<td colspan=3 width=120> </td>
<td colspan=3 width=120> </td>
</tr>
<%
do while not rs.eof
do while not rs1.eof
do while not rs2.eof
do while not rs3.eof
do while not rs4.eof
do while not rs5.eof
%>
<tr>
<td><%=rs("k1")%></td>
<td> </td>
<%
a = a + 1
response.write "<td>" & a & "</td>"
%>
<td><%=rs1("k2")%></td>
<td> </td>
<%
b = b + 1
response.write "<td>" & b & "</td>"
%>
<td><%=rs2("k3")%></td>
<td> </td>
<%
c = c + 1
response.write "<td>" & c & "</td>"
%>
<td><%=rs3("k4")%></td>
<td> </td>
<%
d = d + 1
response.write "<td>" & d & "</td>"
%>
<td><%=rs4("k5")%></td>
<td> </td>
<%
e = e + 1
response.write "<td>" & e & "</td>"
%>
<td><%=rs5("k6")%></td>
<td> </td>
<%
f = f + 1
response.write "<td>" & f & "</td>"
%>
</tr>
<%
rs.movenext
rs1.movenext
rs2.movenext
rs3.movenext
rs4.movenext
rs5.movenext
loop
loop
loop
loop
loop
loop
rs.close
rs1.close
rs2.close
rs3.close
rs4.close
rs5.close
conn.close
set conn = nothing
set sqlstmt = nothing
set sqlstmt1 = nothing
set sqlstmt2 = nothing
set sqlstmt3 = nothing
set sqlstmt4 = nothing
set sqlstmt5 = nothing
%>
</table>
<br>
<table width=720 cellpadding=2 cellspacing=0 border=1 bordercolor=black>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> <br><br><br><br><br></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br><br>
<a href="kort.asp">link her</a>
</center>
</font>
</body>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<meta http-equiv="expires" content="fri, jun 12 1981 08:20:00 gmt">
</head>
</html>