Code for random records in the record set
<%
'Movingtorandomrecord-StevenJones'Extension
IfNot(record set name.bofand record set name.eof) Then
'resetthecursortothebeginning
If(Recordset Name.CursorType>0) Then
Recordset name.MoveFirst
Else
Recordset name.Requery
EndIf
Recordset name_totalrn=-1
Recordset name_totalrn=Recordset name.RecordCount'onyworksonsomerecordsets,butmuchfaster
If(record set name_totalrn=-1)Then'andifitdidn'twork,westillhavetocounttherecords.
'countthetotalrecordsbyiteratingthroughtherecordset
Recordset name_totalrn=0
While(Not record set name.EOF)
Recordset name_totalrn=Recordset name_totalrn+1
Recordset name.MoveNext
Wend
'resetthecursortothebeginning
If(Recordset Name.CursorType>0) Then
Recordset name.MoveFirst
Else
Recordset name.Requery
EndIf
EndIf
'nowdofinaladjustments, and movetotherandamrecord
Recordset name_totalrn=Recordset name_totalrn-1
If record set name_totalrn>0Then
Randomize
Recordset name.MoveInt((Recordset name_totalrn+1)*Rnd)
EndIf
EndIf
'alldone; youshouldalwayscheckforanemptyrecordsetbeforedisplayingdata
%>