I want to bring back the entire product list, check how many records there were and use this as a basis for a random number then filter to that record. Any comments most appreciated, thanks.
Quote
<%
Dim random, imgRS, intRecordCount
Set imgRS = Server.CreateObject("ADODB.Recordset")
randomize
random = int((50) * rnd + 100)
mySQL = "SELECT * FROM tblProducts"
imgRS.Open mySQL, imgRS, adOpenDynamic, adLockOptimistic, adCmdText
For intRecordCount = imgRS.RecordCount To random
imgRS.Filter = "lngProductID"
If Not imgRS.EOF Then
Response.Write"<table><tr><td><b>Best Sellers</b></td></tr>"
While Not myRS.EOF
Response.Write"<td>" & imgRS("strImage") & "</td>"
imgRS.MoveNext
Wend
Response.Write"</table>"
End If
Next
imgRS.Close
SetimgRS = Nothing
%>
Dim random, imgRS, intRecordCount
Set imgRS = Server.CreateObject("ADODB.Recordset")
randomize
random = int((50) * rnd + 100)
mySQL = "SELECT * FROM tblProducts"
imgRS.Open mySQL, imgRS, adOpenDynamic, adLockOptimistic, adCmdText
For intRecordCount = imgRS.RecordCount To random
imgRS.Filter = "lngProductID"
If Not imgRS.EOF Then
Response.Write"<table><tr><td><b>Best Sellers</b></td></tr>"
While Not myRS.EOF
Response.Write"<td>" & imgRS("strImage") & "</td>"
imgRS.MoveNext
Wend
Response.Write"</table>"
End If
Next
imgRS.Close
SetimgRS = Nothing
%>

New Topic/Question
Reply



MultiQuote



|