Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2011
    Messaggi
    92

    Paginazione Su Server Vps Aruba

    Buongiorno
    sto cercando di trasferire il sito da uno spazio gratuito aruba ad un server vps aruba.
    Ovviamente si presentano i primi problemi di codice in particolare ho una pagina di elenco utenti che va in crash in quanto c'è un problema con rstUtenti.AbsolutePage = iCurrentPage

    qualcosa da leggere??? Suggerimenti?

    Dim rstUtenti
    Set rstUtenti = Server.CreateObject("ADODB.Recordset")
    ' You can change other settings as with any RS
    'rstUtenti.CursorLocation = adUseClient


    ' ---------------------------------------------------------- BEGIN CODE TO PAGING
    rstUtenti.PageSize = iPageSize
    rstUtenti.CacheSize = iPageSize
    ' ---------------------------------------------------------- END CODE TO PAGING


    ' Open RS
    rstUtenti.Open SQLStatement, conn, 3, 3

    ' ---------------------------------------------------------- BEGIN CODE TO PAGING
    ' Get the count of the pages using the given page size
    iPageCount = rstUtenti.PageCount

    ' Check page count to prevent bombing when zero results are returned!
    If iPageCount = 0 Then
    'Response.Write "No records found!"
    Else
    ' Move to the selected page
    rstUtenti.AbsolutePage = iCurrentPage
    End if


    ' Calculate iPreviousPage iNextPage values
    select case Action
    case "Stay"
    ' Leggo la pagina corrente la pagina prev e la next
    If iCurrentPage = 1 Then
    iPreviousPage = -1 * iPagesShown + 1
    iNextPage = 1 + iPagesShown
    if iNextPage > iPageCount then
    iNextPage = iPageCount + 1
    end if
    end if

    case "GoNext", "GoPrevious"
    ' Leggo solo la pagina corrente
    iPreviousPage = iCurrentPage - iPagesShown
    if iPreviousPage < 1 then
    iPreviousPage = -1 * iPagesShown + 1
    end if
    iNextPage = iCurrentPage + iPagesShown
    if iNextPage > iPageCount then
    iNextPage = iPageCount + 1
    end if

    end select

    Dim LeftCell
    if iPreviousPage = (-1 * iPagesShown) + 1 Then
    LeftCell = ""
    else
    LeftCell = "[img][/img]"
    end if

    Dim CenterCell
    if iPageCount > 1 then
    for I=iPreviousPage + iPagesShown to iNextPage - 1
    if I <> CINT(iCurrentPage) then
    CenterCell = CenterCell & "" & i & ""
    else
    CenterCell = CenterCell & "<font face=""Arial, Helvetica, sans-serif"" size=""3"" color=""white"">" & i & "</font>"
    end if
    next
    else
    CenterCell = ""
    end if

    Dim RightCell
    if iNextPage = iPageCount + 1 Then
    RightCell = ""
    else
    RightCell = "[img][/img]"
    end if

    ' ---------------------------------------------------------- END CODE TO PAGING

    %>

  2. #2
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    - Sicuro che il vps sia configurato a dovere?
    - D'aver impostato tutti i diritti nella cartella database?
    - Che ci sia la connessione al database?
    - Che la query alla tabella utenti sia presente? (che non vedo nel codice)
    Se di tutto questo sei sicuro il tutto deve andare
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2011
    Messaggi
    92
    c'è tutto... anche io ho dubbi sui permessi. per sicurezza ti posto tutto il codice. quattro occhi sono meglio di due.
    l'errore è preciso è

    ADODB.Recordset error '800a0cb3'
    Current Recordset does not support bookmarks. This may be a limitation of
    the provider or of the selected cursortype.
    /ElencoFornitori.asp, line 128

    ovvero
    rstUtenti.AbsolutePage = iCurrentPage


    codice:
    <%@ Language = VBScript %> <% Response.addheader "pragma","no-cache" %> <% Response.buffer=true %> <% Session.Timeout = 120 %>     </script> <% Dim RagSocSrc: RagSocSrc = Trim(Request.Form("RagSocSrc")) Dim PIvaSrc: PIvaSrc = Trim(Request.Form("PIvaSrc")) Dim CittaSrc: CittaSrc = Trim(Request.Form("CittaSrc")) ' Apro la connessione al database Set conn = Server.CreateObject("ADODB.Connection") conn.Open StrConn if Request.QueryString("Elimina") = "1" then conn.Execute "DELETE * FROM Utenti WHERE IDUtente = " & Request.QueryString("IDUtente") end if Const BLANK = "" function Selected (FirstValue, SecondValue) if cStr(FirstValue) = cStr(SecondValue) then Selected = "Selected" end if end function ' ---------------------------------------------------------- BEGIN CODE TO PAGING ' Declare our vars Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim iPagesShown 'The number of pages we show - cyb Dim iCurrentPage 'The page we want to show Dim iPreviousPage 'Cyb Dim iNextPage 'Cyb Dim Action 'Cyb Dim iRecordsShown 'Loop controller for displaying just iPageSize records Dim I 'Standard looping var ' Get parameters iPageSize = 15 'You could easily allow users to change this iPagesShown = 10 'You could easily allow users to change this ' Retrieve page to show or default to 1 If Request.QueryString("Action") = "" Then Action = "Stay" iCurrentPage = 1 Else Action = Request.QueryString("Action") ' All valued if action = Stay iCurrentPage = CInt(Request.QueryString("CurrentPage")) iNextPage = CInt(Request.QueryString("NextPage")) iPreviousPage = CInt(Request.QueryString("PreviousPage")) End If ' ---------------------------------------------------------- END CODE TO PAGING Dim SQLStatement Dim SQLWhere SQLWhere = "WHERE Tipo = 'Fornitore' " if trim(RagSocSrc) <> "" then SQLWHERE = SQLWHERE & " AND RAGIONESOCIALE LIKE '%" & RagSocSrc & "%' " end if if trim(PIvaSrc) <> "" then SQLWHERE = SQLWHERE & " AND PARTITAIVA LIKE '%" & PIvaSrc & "%' " end if if trim(CittaSrc) <> "" then SQLWHERE = SQLWHERE & " AND CITTA LIKE '%" & CittaSrc & "%' " end if if Session("Tipo") = "Admin" then SQLStatement = "SELECT * FROM QUtenti " & SQLWHERE & " ORDER BY RAGIONESOCIALE" else SQLStatement = "SELECT * FROM QUtenti " & SQLWHERE & " AND INSERITO_DA = " & Session("IDUtente") & " ORDER BY RAGIONESOCIALE" end if Dim rstUtenti Set rstUtenti = Server.CreateObject("ADODB.Recordset") ' You can change other settings as with any RS 'rstUtenti.CursorLocation = adUseClient ' ---------------------------------------------------------- BEGIN CODE TO PAGING rstUtenti.PageSize = iPageSize rstUtenti.CacheSize = iPageSize ' ---------------------------------------------------------- END CODE TO PAGING ' Open RS rstUtenti.Open SQLStatement, conn, 3, 3 ' ---------------------------------------------------------- BEGIN CODE TO PAGING ' Get the count of the pages using the given page size iPageCount = rstUtenti.PageCount ' Check page count to prevent bombing when zero results are returned! If iPageCount = 0 Then 'Response.Write "No records found!" Else ' Move to the selected page rstUtenti.AbsolutePage = iCurrentPage End if ' Calculate iPreviousPage iNextPage values select case Action case "Stay" ' Leggo la pagina corrente la pagina prev e la next If iCurrentPage = 1 Then iPreviousPage = -1 * iPagesShown + 1 iNextPage = 1 + iPagesShown if iNextPage > iPageCount then iNextPage = iPageCount + 1 end if end if case "GoNext", "GoPrevious" ' Leggo solo la pagina corrente iPreviousPage = iCurrentPage - iPagesShown if iPreviousPage < 1 then iPreviousPage = -1 * iPagesShown + 1 end if iNextPage = iCurrentPage + iPagesShown if iNextPage > iPageCount then iNextPage = iPageCount + 1 end if end select Dim LeftCell if iPreviousPage = (-1 * iPagesShown) + 1 Then LeftCell = "" else LeftCell = "[img][/img]" end if Dim CenterCell if iPageCount > 1 then for I=iPreviousPage + iPagesShown to iNextPage - 1 if I <> CINT(iCurrentPage) then CenterCell = CenterCell & "" & i & "" else CenterCell = CenterCell & "<font face=""Arial, Helvetica, sans-serif"" size=""3"" color=""white"">" & i & "</font>" end if next else CenterCell = "" end if Dim RightCell if iNextPage = iPageCount + 1 Then RightCell = "" else RightCell = "[img][/img]" end if ' ---------------------------------------------------------- END CODE TO PAGING %>

  4. #4
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Se hai dei dubbi sui permessi, ricontrolla tutto, poi fai una pagina test di lettura/scrittura di un record in una tabella.

    P.S. Quando posti il codice usa i tasto [code] .... [ /code]
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2011
    Messaggi
    92
    Scusa hai ragione. Nel frattempo ho fatto una prova con lo script di Roby. Ho preso tutto compreso db ecc ecc e l'ho messo su e funziona. Quindi non è questione di permessi.
    Siccome il codice lo vedo abbastanza simile sto cercando l'errore. Credo l'attenzione si debba concentrare su

    codice:
    rstUtenti.Open SQLStatement, conn, 3, 3
    Che ne pensi?

  6. #6
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Originariamente inviato da apuuuu
    Scusa hai ragione. Nel frattempo ho fatto una prova con lo script di Roby. Ho preso tutto compreso db ecc ecc e l'ho messo su e funziona. Quindi non è questione di permessi.
    Non ne sarei cosi sicuro http://www.html.it/articoli/cursortype-e-locktype-2/
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  7. #7
    Utente di HTML.it
    Registrato dal
    May 2011
    Messaggi
    92
    risolto così

    codice:
    rstUtenti.Open SQLStatement, conn, 3
    e funziona

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.