Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11
  1. #1

    Errore IIS su rs.absolutePage

    ciao
    ho trovato questo codice...
    volevo usarlo, ma non capisco perchè IIS mi da questo errore:
    codice:
    Informazioni tecniche (per il personale del supporto tecnico)
    
    Tipo di errore:
    ADODB.Recordset (0x800A0CB3)
    Il set di record corrente non supporta i segnalibri. Potrebbe trattarsi di una limitazione del provider o del tipo di cursore selezionato.
    /item.asp, line 54
    
    
    Tipo di browser:
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727) 
    
    Pagina:
    GET /item.asp
    questo il codice:
    in rosso la riga di errore.

    codice:
    Dim rs, SQL
    Set rs = Server.CreateObject("ADODB.Recordset")
      
    RecordsPerPagina = 10 
    page = Request.QueryString("page") 
    if page="" then page=1 
    ' STRINGA SQL 
     
    SQL = "SELECT * FROM "&tipo&" t,categoria c WHERE c.id=t.categoria and c.nome='"&categoria&"';"
    rs.Open SQL, DB_CONNECTIONSTRING, 1, 3 
    
    
    rs.PageSize = RecordsPerPagina 
    Response.Write(page)
    
    
     rs.AbsolutePage = page  
    If rs.Eof=True or rs.Bof=True then 
      Response.Write "
    
    Nessun risultato trovato</P>" 
    Else 
      For i=1 to RecordsPerPagina 
         if Not rs.EOF then 
            Response.Write("
    
    "&rs("codice")&"</p>")
            rs.MoveNext 
         end if 
      Next 
    End if
    aiuto...
    stex1984

  2. #2
    metti rs.pagesize e rs.absolutePage nell'else, non prima dell'if... ovvero impostali solo se sei sicuro che nel rs ci sia qualcosa
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  3. #3
    così?
    codice:
    Dim rs, SQL
    Set rs = Server.CreateObject("ADODB.Recordset")
      
    RecordsPerPagina = 10 
    page = Request.QueryString("page") 
    if page="" then page=1 
    ' STRINGA SQL 
     
    SQL = "SELECT * FROM "&tipo&" t,categoria c WHERE c.id=t.categoria and c.nome='"&categoria&"';"
    rs.Open SQL, DB_CONNECTIONSTRING, 1, 3 
    
    
    
    If rs.Eof=True or rs.Bof=True then 
      Response.Write "
    
    Nessun risultato trovato</P>" 
    Else 
    rs.PageSize = RecordsPerPagina 
    rs.AbsolutePage = page  
      For i=1 to RecordsPerPagina 
         if Not rs.EOF then 
            Response.Write("
    
    "&rs("codice")&"</p>")
            rs.MoveNext 
         end if 
      Next 
    End if
    Stesso errore!!!
    Ma IIS supporta questo absolutePage?
    stex1984

  4. #4
    il database è access?


    altrimenti prova con rs.open sql,db_connection, 3,3


    non è che usi MySql?
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  5. #5
    si mysql 5.
    gia provato con 3,3 non va!!!
    stex1984

  6. #6
    Originariamente inviato da stex1984
    si mysql 5.
    gia provato con 3,3 non va!!!

    ecco lo sapevo...con mysql non funziona quel gioco


    devi usare la paginazione usando la clausola LIMIT nell'sql...cerca sul supporto di mysql per informazioni o qui sul forum
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  7. #7
    ah...
    capisco...
    grazie lo stesso!!!

    ne ho trovato uno sulla rete che usa questo LIMIT...
    lo provo e ti faccio sapere!

    stex1984

  8. #8
    ok... questo codice sembra funzionare... da soloun problema. nelle pagine successive da sempre il contenuto della prima pagina...
    help!!!
    codice:
    Set rs = Server.CreateObject("ADODB.Recordset")
    RecordsPerPagina = 6
    
    page = Request("page")
    if page="" then page=1
    
    
    strRicerca = Request("ricerca")
    SQL = "SELECT * FROM "&tipo&" t,categoria c WHERE c.id=t.categoria and c.nome='"&categoria&"'"
    rs.Open SQL, DB_CONNECTIONSTRING, 1, 3 
    
    intStart = CInt((page-1) * RecordsPerPagina)
    SQL = SQL & " LIMIT " & intStart & ", " & RecordsPerPagina &";"
    
    
    Response.Write(SQL)
    
    If rs.Eof=True or rs.Bof=True then
      Response.Write "
    
    Nessun risultato trovato</P>"
    Else
    rs.PageSize = RecordsPerPagina
    'rs.AbsolutePage = page
    For i=1 to RecordsPerPagina
    
      if Not rs.EOF then
        
    	Response.Write(rs("codice"))
    
        rs.MoveNext
      end if
    
    Next
    
    End if
    
    Dim Conn 
    Set Conn = Server.CreateObject("ADODB.Connection") 
    Conn.Open DB_CONNECTIONSTRING
    
    
    ' stampo le pagine
    ' RISULTATI TOTALI
    SQLCount = "SELECT COUNT(*) as totale FROM "&tipo&" t,categoria c WHERE c.id=t.categoria and c.nome='"&categoria&"'"
    
    set rsCount = Conn.Execute(SQLCount)
    totale = rsCount("totale")
    rsCount.Close
    set rsCount = Nothing
    
    ' PAGINE TOTALI
    maxpages = totale \ RecordsPerPagina
    
    ' correzione di eventuali imprecisioni
    if totale mod RecordsPerPagina <> 0 then
      maxpages = maxpages + 1
    end if
    
    ' TUTTE LE PAGINE
    
    Response.Write "
    
    Pagine: "
    For pag=1 to maxpages
    
      Response.Write "<A href='item.asp?cat="&categoria&"&item="&tipo&"&page=" & pag
      'Response.Write "&" & Server.UrlEncode(strRicerca)
      Response.write "'>"
    
      Response.Write pag
    
      Response.Write "</A> "
    
    Next
    
    Response.Write "</P>"
    stex1984

  9. #9
    fatti stampare la query sql per vedere se al cambio di pagina si modifica correttamente
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  10. #10
    trovato l'errore!!!!

    le query viene eseguita senza limit perchè è dopo l'esecuzione...
    piccolo errore di scrittura del codice!!!
    ho invertito:

    rs.Open SQL, DB_CONNECTIONSTRING, 1, 3

    con

    intStart = CInt((page-1) * RecordsPerPagina)
    SQL = SQL & " LIMIT " & intStart & ", " & RecordsPerPagina &";"

    ed ora funge!!!

    grazie 1000 per l'aiuto!!!!!

    stex1984

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 © 2026 vBulletin Solutions, Inc. All rights reserved.