Scusate ma non trovo la discussione precedente nella quale si parlava di questo problema e quindi ne ho aperta una nuova.
Pensavo andasse tutto bene in questa paginazione ma......
non capisco perche mi deve funzionare per tutte le opzioni tranne per l'opzione eta.
Il ragionamento è uguale per tutte le variabili ma non funziona per eta
Perfavore potreste correggere il problema?????
LO SCRIPT E' ON LINE QUI
codice:iPageSize = 5 'NUMERO RECORD PER PAGINA If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If '***********************costruisco la SELECT ************************* Dim strSQL , VarEta , link strSQL = "SELECT * FROM schede" strTXT = "" If Request("regione") <> "" Then strTXT = " regione = '" & Request("regione") &"'" end if If Request("provincia") <> "" Then if strTXT = "" then strTXT = " provincia = '" & Request("provincia") & "'" else strTXT = strTXT & " AND provincia = '" & Request("provincia") & "'" end if end if if Request("sesso") <> "" Then if strTXT = "" then strTXT = " sesso = '" & Request("sesso") &"'" else strTXT = strTXT & " AND sesso = '" & Request("sesso") & "'" end if end if if Request("foto") <> "" Then if strTXT = "" then strTXT = " foto = '" & Request("foto") &"'" else strTXT = strTXT & " AND foto = '" & Request("foto") & "'" end if end if Select Case Request("eta") Case 1 VarEta = "Between '18' And '30'" Case 2 VarEta = "Between '31' And '40'" Case 3 VarEta = "Between '41' And '50'" Case 4 VarEta = "Between '51' And '60'" Case 5 VarEta = "Between '61' And '99'" Case Else VarEta = "0" End Select if VarEta <> "0" Then if strTXT = "" then strTXT = " eta " & VarEta else strTXT = strTXT & " AND eta " & VarEta end if end if if strTXT <> "" then strSQL = strSQL &" WHERE"& strTXT end if strSQL = strSQL & " ORDER BY cognome ASC" '***********************link pagine successive **************** link = "default_avanzata.asp?" linkstrTXT = "" If Request("regione") <> "" Then linkstrTXT = "regione=" & Request("regione") end if If Request("provincia") <> "" Then if linkstrTXT = "" then linkstrTXT = "provincia=" & Request("provincia") else linkstrTXT = linkstrTXT & "&provincia=" & Request("provincia") end if end if if Request("sesso") <> "" Then if linkstrTXT = "" then linkstrTXT = "sesso=" & Request("sesso") else linkstrTXT = linkstrTXT & "&sesso=" & Request("sesso") end if end if if Request("foto") <> "" Then if linkstrTXT = "" then linkstrTXT = "foto=" & Request("foto") else linkstrTXT = linkstrTXT & "&foto=" & Request("foto") end if end if Select Case Request("eta") Case 1 VarEta = "Between '18' And '30'" Case 2 VarEta = "Between '31' And '40'" Case 3 VarEta = "Between '41' And '50'" Case 4 VarEta = "Between '51' And '60'" Case 5 VarEta = "Between '61' And '99'" Case Else VarEta = "0" End Select if VarEta <> "0" Then if linkstrTXT = "" then linkstrTXT = " eta " & VarEta else linkstrTXT = linkstrTXT & "&eta=" & VarEta end if end if if linkstrTXT <> "" then link = link & linkstrTXT & "&page" else link = link & "page" end if response.Write(strSQL) response.Write(" ") response.Write(link) response.Write(Request.QueryString("page")) response.Write(" ") response.Write("ETA =" & Request("eta") ) response.Write(" ") '******************************************* Set objRS = Server.CreateObject("ADODB.Recordset") objRS.PageSize = iPageSize objRS.CacheSize = iPageSize objRS.Open strSQL, Conn, 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 " <table><td><font face='verdana' size='3' color='#000000'><align center>Non sono state trovate schede</td></table></center></p>" Else objRS.AbsolutePage = iPageCurrent iRecordsShown = 0 %> <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%"> <tr> <td bgcolor="#cccccc"> <table cellpadding="2" cellspacing="1" border="0" width="100%"> <tr height="22"> <td bgcolor="#dddddd" WIDTH="4%"align="center"><font face="verdana" size="1" color="#000000">[b]N°</font></td> <td bgcolor="#dddddd" WIDTH="12%" align="center"><font face="verdana" size="1" color="#000000">Cognome e Nome </font></td> <td bgcolor="#dddddd" WIDTH="12%" align="center"><font face="verdana" size="1">Email</font></td> <td bgcolor="#dddddd" WIDTH="5%" align="center"><font size="1" face="verdana">Sesso</font></td> <td bgcolor="#dddddd" WIDTH="5%" align="center"><font size="1" face="verdana">Età</font></td> <td bgcolor="#dddddd" WIDTH="5%" align="center"><font face="verdana" size="1">Prov.</font></td> <td bgcolor="#dddddd" WIDTH="30%" align="center"><font face="verdana" size="1">Descrizione</font></td> <td bgcolor="#dddddd" WIDTH="10%" align="center"><font face="verdana" size="1">Foto 1</font></td> <td bgcolor="#dddddd" WIDTH="10%" align="center"><font face="verdana" size="1">Foto 2</font></td> </tr> <% 'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL 'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA 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 = "#ccccff" End if Response.Write "<tr bgcolor = " & bg & "><td><font color='#000000' face='Verdana' size='2'><center>" & (iPageSize*iPageCurrent)-iPageSize+Cont & "</font></td>" Response.write "<td><font color='#000000' face='Verdana' size='1'><A HREF='../visualizza/scheda_utente.asp?email=" Response.Write( objRS("email") ) Response.write "'>" Response.Write( objRS("cognome") & " " & objRS("nome") ) Response.write "</A> </font></td>" Response.Write "<td><font color='#000000' face='Verdana' size='1'><center>" & objRS("email") & "</font></center></td>" Response.Write "<td><font color='#000000' face='Verdana' size='1'><center>" & objRS("sesso") & "</font></center></td>" Response.Write "<td><font color='#000000' face='Verdana' size='1'><center>" & objRS("eta") & "</font></center></td>" Response.Write "<td><font color='#000000' face='Verdana' size='1'><center>" & objRS("provincia") & "</font></center></td>" Response.Write "<td><font color='#000000' face='Verdana' size='1'>" & objRS("descrizione") & "</font></td>" Response.Write "<td> <center> [img] & objRS([/img]</center></td>" Response.Write "<td> <center> [img] & objRS([/img]</center></td>" Cont = Cont + 1 'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB iRecordsShown = iRecordsShown + 1 objRS.MoveNext Loop 'PULIZIA DEGLI OGGETTI ADO objRS.Close Set objRS = Nothing %> </table> </td> </tr> </table> <%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%> <% Conn.Close Set objConn = Nothing %> </TD> </TR> </TABLE>

Rispondi quotando
VVoVe: 