set rs = conn.execute(‘Select count(id) from someTable‘)
rCount = rs(0)
‘ ***** (step 2) *****
set rs = conn.execute(“select id from someTable”)
cnt = 1
dim RRs
redim RRs(rCount)
do while not rs.eof
RRs(cnt) = rs(0)
cnt = cnt + 1
rs.movenext
loop
‘ ***** (step 3) *****
randomize
currentRR = cLng(rnd*rCount+0.5)
ID = RRs(currentRR)
‘ ***** (step 4) *****
sql = “select otherfield from someTable where id=” & ID
set rs = conn.execute(sql)
response.write “ID # ” & ID & “ = ” & rs(0)
rs.close: set rs = nothing
conn.close: set conn = nothing