Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2004
    Messaggi
    11

    Problemi con paginazione mai avuti

    Ciao,
    ho una paginazione che mi è sempre funzionata anche nei casi più estremi,ma stavolta no funziona.
    L'unica differenza dalle altre è che ho due do while not ... perchè il layout della pagina non è uguale per tutti i record.
    L'errore che mi dà consiste nel fatto che non mi visualizza gli ultimi record ovvero l'ultima pagina.
    Questo è il codice:


    <%
    pg=request.querystring("pg")
    if request.querystring("giorno") <> "" then
    giorno=request.querystring("giorno")
    mese=request.querystring("mese")
    anno=request.querystring("anno")
    else
    giorno=request.form("giorno")
    mese=request.form("mese")
    anno=request.form("anno")
    end if

    %>
    html etc.
    <%set Conn=Server.CreateObject("ADODB.Connection")
    set st=Server.CreateObject("ADODB.Recordset")
    Conn.Open "PROVIDER=MSDASQL;" & _
    "DRIVER={Microsoft Access Driver (*.mdb)}; " & _
    "DBQ=" & server.mappath("ria.mdb")
    st.cursortype=adOpenStatic
    rowcount=0
    pagesize=3
    inizio = (pg - 1) * pageSize
    st.Open "SELECT * FROM agenda WHERE giorno='"&giorno&"' and mese='"&mese&"' and anno='"&anno&"' ", Conn,1
    st.PageSize=3
    st.AbsolutePage = pg
    if not st.bof and not st.eof then
    do while not st.eof and rowcount < 1
    rowcount=rowcount+1%>

    tabella html

    <%st.Movenext
    Loop
    end if
    %>
    html
    <%
    if not st.bof and not st.eof then
    do while not st.eof and rowcount < st.Pagesize

    rowcount=rowcount+1
    %>
    tabella html

    <%

    st.Movenext
    Loop
    end if

    %>
    html
    <%
    IF st.PageCount > 1 THEN %>
    <span class="2">Vai a pagina..</span>
    <%FOR i = 1 TO st.PageCount%>
    <%IF i <> cINT( pg ) THEN %>
    <font color="#000000"> <%=i%></font>&nbsp
    <%ELSE%>
    <span class="2"><font color="#000000"><%=i%></font></span>
    <%
    L=i+1
    H=i-1
    IF st.PageCount = cINT(pg) THEN
    L = st.PageCount
    END IF
    If pg = 1 then
    H = 1
    END IF
    END IF
    NEXT
    end if
    %>

    qualcuno potrebbe aiutarmi a risolvere questo problema?

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2004
    Messaggi
    11

    Help!

    perfavore aiutatemi!
    Scusate se rompo ma non c'e' nessuno che mi sta rispondendo.

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2004
    Messaggi
    11

    continuazione

    ho notato che non visualizza la pagina se non ho almeno 1 record in più rispetto al pagesize

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.