 |
<%
Dim intLowerBound ' Lower bound of the random number range
Dim intUpperBound ' Upper bound of the random number range
Dim intRangeSize ' Size of the range
Dim sngRandomValue ' A random value from 0 to intRangeSize
Dim val ' Our final result - random integer to return
'Response.write("test: 1____")
'response.flush
Randomize()
' Find range size
intLowerBound = 0
intUpperBound = 100
intRangeSize = intUpperBound - intLowerBound + 1
' Get a random number from 0 to the size of the range
sngRandomValue = intRangeSize * Rnd()
' Center the range of possible random numbers over the desired result set
sngRandomValue = sngRandomValue + intLowerBound
' Convert our value to an integer
intRandomInteger = Int(sngRandomValue)
val = intRandomInteger
'Dim op,db
Set db = Server.CreateObject("ADODB.Recordset")
op ="SELECT count(*) FROM Master WHERE instr(master_id,'"&val&"')> 0 and Master.Anudhinavachanam = '1'"
db.open op,cn
if db(0)>0 then
query = "SELECT top 1 book,chapter,verse_no,verse FROM Master WHERE instr(master_id,'"&val&"')> 0 and Master.Anudhinavachanam = '1'"
Else
query = "SELECT book,chapter,verse_no,verse FROM Master WHERE master_id=3470"
end if
rs.open query,cn ',adOpenDynamic, adLockOptimistic, adCmdText
'Response.write("test: "&rs(2)&"____")
'response.flush
while not rs.eof
Response.write("| "& replace(rs(3),"-","") &" | | " & rs(0)&" "& rs(1) &":"& rs(2) &" | ")
rs.movenext
wend
rs.close
%>
|
|