Grazie per la risposta, ma non ti seguo.
I cinque records fissi non sono sempre i primi cinque della tabella... possono essere gli ultimi o possono stare in mezzo alla tabella tra i 4000 records estratti randomicamente... questo è il codice di estrazione random:
codice:
<%
dim iItems()
iMaxItems = 15
strSQL = "SELECT * FROM tabella ORDER BY data desc"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
cont=1
Do While iRecordsShown < iPageSize And Not objRS.EOF
Dim Rig, bg
Rig = Rig + 1
If Rig Mod 2 = 0 then
bg = "#E4E4E4"
Else
bg = "#FFFFFF"
End if
iMax = objRS.recordCount
if iMax < iMaxItems then iMaxItems = iMax
reDim iItems(iMaxItems - 1)
for x = 0 to iMaxItems - 1
randomize()
i = int(iMax * rnd() + 1)
for y = 0 to uBound(iItems)
alreadyExists = false
if iItems(y) = i then
alreadyExists = true
x = x - 1
exit for
end if
next
if not alreadyExists then
iItems(x) = i
end if
next
if not objRS.eof then
for each item in iItems
objRS.moveFirst
objRS.move item - 1
next
end if
' QUI STAMPO I 15 RECORDS ESTRATTI RANDOMICAMENTE
Cont = Cont + 1
iRecordsShown = iRecordsShown + 1
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
%>