rsN.ActiveConnection = CONN_STRING
rsN.Source = "select * from TABLO1 order by ID desc"
rsN.CursorType = 0
rsN.CursorLocation = 2
rsN.LockType = 3
rsN.Open() %>
şeklinde alıyorum verileri 3 erli olarak her kategoriden. Peki bu çıkan verileri her defa farklı olacak şekilde yani RASGELE çekme imkanım varmı ?
Şu alttakiler işe yaramadı :
<%
RANDOMIZE
SQL = "select TOP 5 tSMALLIMAGE, aID, rnd(aID) as randOrder
from t_gallery ORDER BY Rnd(aID)"
set conn = server.createobject("ADODB.Connection")
conn.open "photokyo-pt"
set gall_random=conn.execute(SQL)
Response.Write("<table border=0 width=90 align=center
cellpadding=0 cellspacing=0>")
DO WHILE NOT gall_random.EOF(Q) How can I return Random records from a table? (A) Paste the following function in a new module. '************ Code Begin *********** 'Code courtesy of 'Joe Foster Function Randomizer () As Integer Static AlreadyDone As Integer If AlreadyDone = False Then Randomize : AlreadyDone = True Randomizer = 0 End Function '************ Code End ************* Now to get 100 questions picked at random: select top 100 mytable.*from mytable where randomizer() = 0 order by rnd(isnull(mytable.question) * 0 + 1)
SELECT TOP 10 pkeyEmployeeID, Rnd([pkeyEmployeeID]) AS Expr1, strLastName, FROM tblEmployees ORDER BY Rnd([pkeyEmployeeID]) DESC;Ve de microsoft sitesinden : How to find N records in random order in Access 2002