Hi,
You could do one thing. Get all the ids of the columns into an ASP array, and using the Randomize and RND() function, pick up any one of the array element and then select the database using that id. Like....
<%
'Randomizing the Id of the Term column
'--------------------------------------------------------
Function RandomNumber(intHighestNumber)
Randomize
lowerbound = 0
upperbound = intHighestNumber
randomIndex = Int( ( upperbound - lowerbound + 1 ) * Rnd + lowerbound )
RandomNumber = randomIndex
End Function
Set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open "select iTermId from Term_MST", objConn
If not oRs.EOF Then
myArr = oRs.GetRows()
s = uBound(myArr,2)
rndId = myArr(0,RandomNumber(s))
Else
rndId = 0
End If
oRs.Close
Set oRs = Nothing
'-----------------------------------------------------------------
Set objRs = Server.CreateObject("ADODB.Recordset")
objrs.Open "select vTermName, vImageURL from Term_MST where iTermId= "&rndId&"", objConn
If not objrs.EOF Then
term = objRs("vTermName")
url = objRs("vImageURL")
End If
objRs.Close
Set objRs = Nothing
%>
REgards,
Bhaskardeep Khaund