|
|
|
7i24.Com不停为您服务
' This script was obtained from the Infinite Monkeys Code library at
http://infinitemonkeys.atrax.co.uk
' to re-use, you must keep this text block intact
' copyright (c) Jason Brown/Atrax Internet 2000
' You may modify this script for your own use, keeping this notice
intact
set objCON = Server.CreateObject("ADODB.Connection")
objCON.open "" ' add your dsn here ie :
objCON.open "myDSN"
set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open "SELECT * FROM table", objCON, 3, 1 ' replace with your
own SQL statement
Dim rndMax
rndMax = CInt(objRS.RecordCount)
amRS.MoveFirst
Dim rndNumber
Randomize Timer
rndNumber = Int(RND * rndMax)
objRS.Move rndNumber
' carry out your action here, with the appropriate recordset index
' for example Response.Redirect(objRS("url")) (requires
Response.Buffer = true
' or response.write("<img src=" & objRS("img") & ">")
|
|
|