<%
Dim strSQL, rec, boolFound, intPageNum, intNumRows, intCount, intLinks, intPagina
Const RECORDSPERPAGE = 6
strSQL = "SELECT * FROM tabella1"
Set rec = Server.CreateObject("ADODB.Recordset")
rec.CursorLocation = adUseClient
rec.Open strSQL, Conn, adOpenStatic, adLockReadOnly, adCmdText
rec.PageSize = RECORDSPERPAGE
If ( Request("pn") <> "" ) Then
intPageNum = CInt(Request("pn"))
Else
intPageNum = 1
End If
'Conteggio delle righe
intNumRows = rec.RecordCount
If (intNumRows <> 0) Then
rec.AbsolutePage = intPageNum
'Esposizione dati
For intCount = 1 To rec.PageSize %>
<tr>
<td align="center"> <div align="center">
<center>
<table width="299" bordercolor="#000000" border="1" height="146" cellspacing="0" cellpadding="0">
<tr height="18" style="height:13.4pt">
<td height="11" class="xl24" width="132"><font size="1" face="Tahoma">RIFERIMENTO
/ CODICE</font></td>
<td class="xl25" width="154" style="border-left-style: none; border-left-width: medium" height="11"><font size="1" face="Tahoma"><span style="background-color: #FF9999"><font size="1" face="Tahoma"><%=rec("riferimento")%></font></span></font></td>
</tr>
<tr height="18" style="height:13.4pt">
<td height="10" class="xl26" style="border-top-style: none; border-top-width: medium" width="132"><font size="1" face="Tahoma">COMUNE</font></td>
<td class="xl27" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium" width="154" height="10"><font color="black" size="1" face="Tahoma"><%=rec("localita")%></font></td>
</tr>
<tr height="18" style="height:13.4pt">
<td height="10" class="xl26" style="border-top-style: none; border-top-width: medium" width="132"><font size="1" face="Tahoma">TIPOLOGIA</font></td>
<td class="xl27" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium" width="154" height="10"><font size="1" face="Tahoma"><%=rec("tipologie")%></font></td>
</tr>
<tr height="19" style="height:14.25pt">
<td height="11" class="xl28" style="border-top-style: none; border-top-width: medium" width="132"><font size="1" face="Tahoma">PREZZO</font></td>
<td class="xl29" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium" width="154" height="11"><font size="1" face="Tahoma"><%=rec("prezzo")%></font></td>
</tr>
<tr height="19" style="height:14.25pt">
<td height="6" class="xl28" style="border-top-style: none; border-top-width: medium" width="132"><font size="1" face="Tahoma">MQ</font></td>
<td class="xl29" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium" width="154" height="6"><font size="1" face="Tahoma"><%=rec("mq")%></font></td>
</tr>
<tr height="19" style="height:14.25pt">
<td height="100" class="xl28" style="border-top-style: none; border-top-width: medium" width="286" colspan="2"><font size="1" face="Tahoma"><%=rec("descrizione")%></font></td>
</tr>
<tr height="19" style="height:14.25pt">
<td height="2" class="xl28" style="border-top-style: none; border-top-width: medium" width="286" colspan="2">
<p align="center">" target="_blank">[img]<%=rec([/img]" border="0"></td>
</tr>
</table>
<table width="100%">
<tr>
<td align="center"> <hr> </td>
</tr>
</table>
</center>
</div></td>
</tr>
<% rec.MoveNext
If ( rec.EOF ) Then Exit For
Next
End If %>
<tr>
<td align="center">
<% 'Navigazione sulle pagine
If ( intNumRows > 0 ) Then
Response.Write("<font size='2' face='Arial'>")
Response.Write "Pagina " & intPageNum & " di " & rec.PageCount & "
"
'Pagina precedente
If ( intPageNum > 1 ) Then
Response.Write "«"
End If
'Numeri di pagina
For intLinks = 1 To rec.PageCount
intPagina = intPagina + 1
If intPagina > 20 Then
intPagina = 1
Response.Write("
")
End If
If intLinks = intPageNum Then
Response.Write "<font color='black'>" & intLinks & "</font>"
Else
Response.Write "" & intLinks & ""
End If
Next
'Pagina successiva
If ( intPageNum < rec.PageCount ) Then
Response.Write "»"
End If
Response.Write("</font>")
'Fine navigazione sulle pagine
End If
'Chiusura recordset
rec.Close
Set rec = Nothing
%>
salve questo script funziona come paginazione
č solo un problema di struttura
come faccio a modificare lo script x inserire la paginazione , oltre che alla fine, anche ad inizio pagina???
fatemi sapere
saluti

Rispondi quotando