Link pubblico http://www.big-mama.it/test.asp
codice:
<head>
</head>
<%
' DEFINISCO LE VARIABILI CHE MI SERVONO PER L'APPLICAZIONE
Dim sc, cn, rs, quanti, pag, contatore
' DEFINISCO LA STRINGA DI CONNESSIONE
sc = ""
sc = sc & "driver={Microsoft Access Driver (*.mdb)};dbq="
sc = sc & Server.MapPath("../mdb-database/DB.mdb")
' IMPOSTO LA CONNESSIONE EDIL RECORDSET
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
' APRO LA CONNESSIONE COL DATABASE
cn.Open sc
' DEFINISCO IL NUMERO DI RECORD DA VISUALIZZARE PER OGNI PAGINA
quanti = 11
' RECUPERO IL NUMERO DI PAGINA CORRENTE
' E CONTROLLO CHE NON SIA INFERIORE A 1
pag = Request.QueryString("pag")
If IsNumeric(pag) = False Or pag < 1 Then pag = 1
' IMPOSTO UN CONTATORE
contatore = 1
%>
</head>
<table>
</table><p align="center">
<font face="Verdana" size="2" color="#0000FF">
</font></p>
<div align="center">
<table border="0" width="760" cellspacing="4" cellpadding="3" style="border-collapse: collapse" bgcolor="#CCFFFF">
<tr>
</tr>
</table>
</div> <%
rs.Open "SELECT * FROM test WHERE nome LIKE '%" & nome & "%' AND id LIKE '%" & id & "%' order by id Desc" , cn, 1
rs.PageSize = quanti
rs.AbsolutePage = pag
<%
If rs.EOF Then Response.End
%>
<br>
<div align="center">
<table border="0" width="760" id="table6">
<tr>
<td> <font face="Verdana" size="2">
<p align="center"><b><font face="Tahoma" size="3" color="#FF0000">Nessun
iscrizione</font></b></p>
</font>
</td>
</tr>
</table>
</div>
<br>
<%
Else
%>
<p align="center">
<font face="Verdana" size="2" color="#000080">
<u>Sono stati trovati <b><%=rs.recordCount%></b> iscritti</u><br><br>
</font></p>
<div align="center">
<TABLE BORDER="0" bordercolorlight="#000080" bordercolordark="#00FFFF" width="760" bordercolor="#111111" cellpadding="0" height="75" id="table5">
<TR>
<TD width="41" height="2" bgcolor="#3B98CE">
<p align="center"><font size="1" color="#FFFFFF"><b>Nr</b></font></p>
</TD>
</font>
<TD width="713" height="2" bgcolor="#3B98CE">
<p align="center"><b><font face="Verdana" size="1" color="#FFFFFF">Nome </font></b></p>
</TD>
<font face="Verdana" size="2" color="#000080">
</TR>
<%
While rs.EOF = False And contatore < quanti
%>
<center>
<TR>
<TD valign="middle" height="55" align="left" width="41" bgcolor="#CCFFFF">
<font face="Verdana" size="2" color="#000080">
<p align="center"><font face="Verdana" size="1"><%=contatore%></font></p>
</TD>
<TD height="55" align="left" width="713" bgcolor="#CCFFFF">
<font face="Verdana" size="1">
<%=rs.Fields("Nome")%><br></font></TD>
</TR>
<%
rs.MoveNext
contatore = contatore + 1
Wend
%>
</table></div>
<p align="center">
<%If pag > 1 Then%>
<a href="test.asp?pag=<%=pag-1%>">Indietro</a>
<%End If%>
<%
Dim x
x = 1
For x = 1 To rs.PageCount
If CInt(pag) <> x Then
%>
<a href="test.asp?pag=<%=x%>"><%=x%></a>
<%
Else
%>
<a href="test.asp?pag=<%=x%>"><b><%=x%></b></a>
<%
End If
Next
%>
<%If rs.EOF = False Then%>
<a href="test.asp?pag=<%=pag+1%>">Avanti</a>
<%End If%>
<%
END IF
%>
</p>