After the new ASP website manager test, the available ASP non-repetitive numbers random functions are implemented in an array, and applied to the random display record set
effect:
This function is suitable for randomly displaying small number of random non-repetitive numbers
This function is suitable for displaying small number of random non-repetition recordsets
In order not to affect efficiency, the upper limit is more than one thousand, it is not recommended to use this function
shawl.qiu
2006-09-06
http://blog.csdn.net/btbtd
Main content: 100 records are displayed randomly by functions and application functions
linenum
The code copy is as follows:
<%
dimrs,rNum
dimtemp
setrs=createObject("adodb.recordset")
rs.open"selecttop100*fromrnd_v1",conn,1
rNum=rs.recordCount-1
foreachtempinfRndNoRpt(0,rNum)
rs.movetemp
response.writers("sbcat")
response.write"<br/>"
rs.movefirst
next
rs.close
setrs=nothing'shawl.qiucode'
functionfRndNoRpt(lwNum,upNum)
''''''''''''''''''''''''''''''''''''''''''''
'ASP no repeat number random function, array implementation, Byshawl.qiu
'2006-09-06
'http://blog.csdn.net/btbtd
'''''''''''''''''''''''''''''''''
'Note: The random number exceeds 1000, this function is not recommended.
'''''''''''''''''''''''''''''''''
'Parameter description:
'''''''''''''''''''''''''''''''''
'lwNum is the lower limit of the number array, such as: 1
'upNum is the upper limit of the number array, such as: 100
'''''''''''''''''''''''''''''''''
'samplecall:
'''''''''''''''''''''''''''''''''
'dimt