Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Aiuto su paginazione

  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2003
    Messaggi
    111

    Aiuto su paginazione

    Ciao

    sapete spiegarmi perchè non si vede nessun record, nella prima pagina? Devo fare un loop da qualche parte?

    codice:
    <%
    Dim intPageSize, intRecordCount, intRecords, intLastPage, intCurrentPage
    intPageSize = 3 '--- define the page size you want
    'Lettura
    Dim StrSQL
    SUBConn("pro.mdb")
    	SUBRS()
    		StrSQL = "SELECT * FROM occ"
    		Set ObjRS = Server.CreateObject("ADODB.Recordset")
    		ObjRS.Open StrSQL, Conn ,3,3
    
    'rs.open SQL, Connection, adOpenStatic, adLockReadOnly, adCmdText
    intRecordCount = ObjRS.RecordCount '--- fetch the total number of records in the database
    
    If Not ObjRS.EOF Then
    	If Len(Request.QueryString("page")) > 0 then
    		intCurrentPage = CLng(Request.QueryString("page"))
    	Else
    		intCurrentPage = 1
    	End if
    	For intRecords = 1 to intRecordCount 
    		If intRecords = ((intCurrentPage * intPageSize) - intPageSize) Then
    			Response.Write(ObjRS("Nome")& "
    ")
    
    		End if
    	ObjRS.Movenext
    	Next 
    Else
    	response.write "No record found"
    End if
    	SUBOpenRS()
    SUBCloseConn()
    
    intLastPage = int(intRecordCount/intPageSize) + 1 '--- calculates the last page number
    if intLastPage = 0 then intLastPage = 1 '--- set always last page > 0 to avoid errors
    Call PageNav(intCurrentPage, intLastPage) '--- cal the pagenav function and show navigation commands
    %>
    
    </div>

  2. #2
    io continuo a riproporre il mio sistema
    ovviamente unito a un meccanismo di paginazione efficace (ma in quel topic lo trovi)

    http://forum.html.it/forum/showthrea...41#post9632841

    in ogni caso

    1. nel recordset non è impostata la PAGESIZE
    2. nel recordset non è impostata la ABSOLUTEPAGE

    con quello che hai scritto se il recordset è molto grande c'è un grosso spreco di risorse
    tu "navighi" tutto il recordset fino a quelli che ti interessano

    non è un metodo efficente
    san imente saluta

    * http://simonecingano.it *

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.