<% Option Explicit %> <!-- #include virtual="/adovbs.inc"--> <% Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "DRIVER=SQL Server;SERVER=OFFICEDNS;UID=SSDB;PWD=;DATABASE=SSDB;" objConn.Open Dim objRS Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "SELECT * FROM tblItem WHERE ParentID IS NULL", objConn, adOpenStatic, adLockReadOnly Dim rndMax rndMax = CInt(objRS.RecordCount) objRS.MoveFirst Do WHile Not objRS.EOF Response.Write objRS("ID") & "<BR>" objRS.MoveNext LOOP objRS.MoveFirst Dim rndNumber Randomize Timer rndNumber = Int(RND * rndMax) objRS.Move rndNumber Response.Write objRS("ID") objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing %>