ora funziona, pero' a volte non compare niente come posso risolvere?
<%
SQL = "select Max(id) as maxid from tabella where val >= 1000"
rs.open SQL, cn, 3,3
If Not rs.Eof Then
dim maxID, valorernd
maxID = rs("MaxID")
else
maxid = 0
end if
rs.close
randomize timer
valorernd = cint(rnd * maxid)
sql = "select top 1 val2 from tabella where id = " & valorernd
rs.open SQL, cn, 3,3
if not rs.eof then
if valorernd <> "" then
valores = rs("val2")
response.write valores
end if
end if
rs.close
cn.close
set rs = nothing
set cn = nothing
%>

Rispondi quotando