Lo script è questo:
Graziecodice:<% iPageSize = 40 'NUMERO RECORD PER PAGINA If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If strSQL = "SELECT * FROM tGiocatori ORDER BY giocatore ASC" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.PageSize = iPageSize objRS.CacheSize = iPageSize objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText reccount = objRS.recordcount iPageCount = objRS.PageCount If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 If iPageCount = 0 Then Response.Write "Nessun risultato" Else objRS.AbsolutePage = iPageCurrent iRecordsShown = 0 'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL cont=1 Do While iRecordsShown < iPageSize And Not objRS.EOF Response.Write "Risultati" Cont = Cont + 1 'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB iRecordsShown = iRecordsShown + 1 objRS.MoveNext Loop 'PULIZIA DEGLI OGGETTI ADO objRS.Close Set objRS = Nothing End if %> <%If ipagecount <> 1 Then%> <center> <table> <tr valign="middle"> <td width="50%" align="center" valign="middle"><font face="verdana" size="1" color="#000000">[ <%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%> [img]images/first.gif[/img] <%end if%> <%if iPageCurrent > 1 then%> [img]images/pre.gif[/img] <%end if%> <%if iPageCount > 2 then if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2 if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2 else da_pag = 1 fino_a_pag = iPageCount end if%> <%for i = da_pag to fino_a_pag%> <%if i = iPageCurrent then%> <font color="red"><%=i%></font> <%else%> <%=i%> <%end if%> <%next%> <%if iPageCurrent > 0 and iPageCurrent < iPageCount then%> [img]images/next.gif[/img] <%end if%> <%if iPageCurrent+1 < iPageCount then%> [img]images/last.gif[/img] <%end if%>] </font></td> </tr> <tr> <td colspan="2" align="center"><font face="verdana" size="1" color="#000000"> <center>Pagina<font color="#FF0000"><%=iPageCurrent%></font> di <font color="#FF0000"><%=iPageCount%></font> </center> </font></td> </tr> </table> </center> <%end if%> <% objConn.Close Set objConn = Nothing %>![]()

Rispondi quotando