'random product
Dim rsRdmProduct,strProduct
strProduct = "select * from vProducts where pNewBool = 'New' and pDisplayBool = 'Show'"
Set rsRdmProduct=server.CreateObject("adodb.recordset")
rsRdmProduct.CursorLocation = 3
rsRdmProduct.Open strProduct,conn,3,3
Dim rs_totalrn
rs_totalrn = rsRdmProduct.RecordCount
If rs_totalrn > 0 Then
Randomize
rsRdmProduct.Move Int((rs_totalrn + 1) * Rnd)
End If
Response.Write(Int((rs_totalrn + 1) * Rnd))
Asp获取随机记录
最新推荐文章于 2021-01-26 16:14:30 发布