Visualizzazione dei risultati da 1 a 3 su 3

Discussione: pagesize

  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    67

    pagesize

    nonostante abbia impostato il pagesize continua a farmi vedere sempre tutti i record
    dove sbaglio!
    grazie!

    <%
    ' FUNZIONE CHE MI RESTITUISCE IL TITOLO DI UN ID
    ' ----------------------------------------------
    function leggimes(id)
    strSQL = "SELECT * FROM messaggi WHERE rif = "&id
    dbname = database("forum")
    set adoRes = esegui2(strSQL,dbname)
    adoRes.PageSize=2
    adoRes.AbsolutePage=1
    do while (adoRes.EOF = False)
    %>
    <tr>
    <td width="240" <%=bordo%>><p class="forum2"><%=adores(2)%><%modcancmess(adores)%></td>
    <td width="130" <%=bordo%>><p class="forum3"><%=adores(1)%><p class="forum3"><%=adores(5)%></font></td>
    <td width="40" <%=bordo%>><p class="forum3"><%=datimess("nmess",adores(0))%></font></td>
    <td width="130" <%=bordo%>><p class='forum3'><%=datimess("ultmess",adores(0))%></font></td>
    </tr>
    <%
    adoRes.movenext
    loop
    closeDBconn adores
    %>
    <tr>
    <td width="240" align="left"><p class="forum4">prec</td>
    <td width="130"><p class="forum3"></td>
    <td width="30"><p class="forum3">[/b]</td>
    <td width="130"><p class="forum5">succ</td>
    </tr>
    <%

    end function
    %>

  2. #2
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133

    Re: pagesize

    Originariamente inviato da analce
    nonostante abbia impostato il pagesize continua a farmi vedere sempre tutti i record
    dove sbaglio!
    grazie!

    <%
    ' FUNZIONE CHE MI RESTITUISCE IL TITOLO DI UN ID
    ' ----------------------------------------------
    function leggimes(id)
    strSQL = "SELECT * FROM messaggi WHERE rif = "&id
    dbname = database("forum")
    set adoRes = esegui2(strSQL,dbname)
    adoRes.PageSize=2
    adoRes.AbsolutePage=1
    do while (adoRes.EOF = False)
    %>
    <tr>
    <td width="240" <%=bordo%>><p class="forum2"><%=adores(2)%><%modcancmess(adores)%></td>
    <td width="130" <%=bordo%>><p class="forum3"><%=adores(1)%><p class="forum3"><%=adores(5)%></font></td>
    <td width="40" <%=bordo%>><p class="forum3"><%=datimess("nmess",adores(0))%></font></td>
    <td width="130" <%=bordo%>><p class='forum3'><%=datimess("ultmess",adores(0))%></font></td>
    </tr>
    <%
    adoRes.movenext
    loop
    closeDBconn adores
    %>
    <tr>
    <td width="240" align="left"><p class="forum4">prec</td>
    <td width="130"><p class="forum3"></td>
    <td width="30"><p class="forum3">[/b]</td>
    <td width="130"><p class="forum5">succ</td>
    </tr>
    <%

    end function
    %>
    Prova questo:
    codice:
    function leggimes(id)
    	strSQL = "SELECT * FROM messaggi WHERE rif = "&id
    	dbname = database("forum")
    	set adoRes = esegui2(strSQL,dbname)
            IF adoRes.EOF and adoRes.BOF Then
            Else
            RecordsPerPagina = 2
            page = Request("page")
            if page="" then page=1
    	adoRes.PageSize=RecordsPerPagina
    	adoRes.AbsolutePage=page
    	For i=1 to RecordsPerPagina
    	if Not adoRes.EOF then
    	%>
    	<tr>
    	<td width="240" <%=bordo%>><p class="forum2"><%=adores(2)%><%modcancmess(adores)%></td>
    	<td width="130" <%=bordo%>><p class="forum3"><%=adores(1)%><p class="forum3"><%=adores(5)%></font></td>
    	<td width="40" <%=bordo%>><p class="forum3"><%=datimess("nmess",adores(0))%></font></td>
    	<td width="130" <%=bordo%>><p class='forum3'><%=datimess("ultmess",adores(0))%></font></td>
    	</tr>
    	<%
    	adoRes.movenext
    	end if
    	Next
    End if
    Response.Write("<center>Pagine:")
    For p=1 to rs.PageCount
    If  p <> CInt(Page) then
    Response.Write("<A target='_self' href='nometuapagina.asp?page=" & p) 
    Response.write("'>")
    Else
    ' pagina attuale
    Response.Write ("")
    End if
    Response.Write p
    If  p <> CInt(Page) then
    Response.Write (" </A> ")
    Else
    Response.Write (" ")
    Next
    End if
    	closeDBconn adores
    	%>
    	<tr>
    	<td width="240" align="left"><p class="forum4">prec</td>
    	<td width="130"><p class="forum3"></td>
    	<td width="30"><p class="forum3">[/b]</td>
    	<td width="130"><p class="forum5">succ</td>
    	</tr>
    	<%end function%>
    La parte in grassetto devi inserirre i recordset che vuoi visualizzare nella pagina

    Ciao
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    67
    ti ringrazio ma ho trovato, dimenticavo di incremetare le pagine e di controllare che non fossero arrivate alla fine!
    grazie cmq!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.