Código para registros aleatorios en el conjunto de registros
<%
'MovingTorandomRecord-Stevenjones'Extension
Ifnot (grabar nombre de nombre.Bofand Regy Set Name.EOF) entonces entonces
'RESETTHECURSORTOTHEBEGININING
If (RecordSet name.cursortype> 0) Entonces
Nombre de registro. MOVEFIRST
Demás
Registro Nombre. Requerir
Endif
RecordSet name_totalrn = -1
RecordSet name_totalrn = Recordset name.RecordCount'onyworkSonsomerecordsets, Butmuchfaster
If (registrar set name_totalrn = -1) entonces'andifitDidididwork, WestillhaveToCountThereCords.
'CountThetTalRecordsByiteratingThroughTherecordSetset
RecordSet name_totalrn = 0
While (no grabar nombre de nombre.eof)
Recordset name_totalrn = Recordset name_totalrn+1
Recordset Name.movenext
Encaminarse a
'RESETTHECURSORTOTHEBEGININING
If (RecordSet name.cursortype> 0) Entonces
Nombre de registro. MOVEFIRST
Demás
Registro Nombre. Requerir
Endif
Endif
'NowDoFinalDjustments y MovetotheryAndAndam
RecordSet name_totalrn = Recordset name_totalrn-1
Si registrará name_totalrn> 0then
Aleatorizar
RecordSet Name.MoveInt ((RecordSet name_totalrn+1)*rnd)
Endif
Endif
'Alldone; YouShouldalwaysCheckforAntimtyRecordSetBeForedIsplayingData
%>