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

    Problemi con numerazione

    Buongiorno a tutti, questo fine settimana ho avuto una bella sorpresa , dopo aver messo la paginazione a numeri per sfogliare utenti , foto ecc del mio portale mi sono accorto che :

    nella galleria dopo 13 pagine va in errore

    nella pagina cerca (utenti) gia alla seconda va in errore

    e' l'errore generato, che personalmente non ho mai visto e non so a cosa puo' riferirsi e' il seguente:
    ------------------------------------------------------
    Active Server Pages error 'ASP 0115'

    Unexpected error

    /Pub_Gallery/ElencoFoto.asp

    A trappable error (C0000005) occurred in an external object. The script cannot continue running.
    -------------------------------------------------------

    Non riesco proprio a capire cosa possa essere anche perche' non va in errore subito ma solo dopo un tot di pagine.

    Se fosse necessario posso postare la sorgente della pagina e del File incluso.

    ringrazio in anticipo tutti per ogni eventuale aiuto, contando che tutto il portale è bloccato per questo errore se riuscissi a risolvere avrete la mia eterna gratitudine.

    Saluti

  2. #2
    posta il codice, che c'ho la boccia di vetro a riparare da Pino lo stagnaro

  3. #3


    Questa e' la pagina:

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>


    <%
    Dim VP,NRecord
    Nrecord=20
    VP=1
    if Request.querystring("P")<>"" then
    VP=Request.querystring("P")
    end if
    %>
    <%
    ' *** Restrict Access To Page: Grant or deny access to this page
    MM_authorizedUsers=""
    MM_authFailedURL="../Pub_Portale/LogIn.asp"
    MM_grantAccess=false
    If Session("MM_Username") <> "" Then
    If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
    (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
    MM_grantAccess = true
    End If
    End If
    If Not MM_grantAccess Then
    MM_qsChar = "?"
    If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    MM_referrer = Request.ServerVariables("URL")
    if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
    MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
    Response.Redirect(MM_authFailedURL)
    End If
    %>
    <%
    Dim Visitatore__UT
    Visitatore__UT = "1"
    If (Session("MM_Id_Ut") <> "") Then
    Visitatore__UT = Session("MM_Id_Ut")
    End If
    %>
    <%
    Dim Visitatore
    Dim Visitatore_numRows

    Set Visitatore = Server.CreateObject("ADODB.Recordset")
    Visitatore.ActiveConnection = MM_Admin_STRING
    Visitatore.Source = "SELECT St_Attivo FROM Anagrafica_Generica WHERE Id_Ut='" + Replace(Visitatore__UT, "'", "''") + "'"
    Visitatore.CursorType = 0
    Visitatore.CursorLocation = 2
    Visitatore.LockType = 1
    Visitatore.Open()

    Visitatore_numRows = 0
    %>

    <%'protezione se utente in visita non e' ancora stato attivato
    if (Visitatore.Fields.Item("St_Attivo").Value)="A" then%>
    <%response.Redirect("../Pub_Portale/Errori.asp?Errore=AT")%>
    <%
    Visitatore.Close()
    Set Visitatore = Nothing
    %>
    <%end if%>
    <%'protezione se utente in visita cerca di forzare sistema dopo cancellazione
    if (Visitatore.Fields.Item("St_Attivo").Value)="N" then%>
    <%response.Redirect("../Pub_Portale/LogOut.asp")%>
    <%
    Visitatore.Close()
    Set Visitatore = Nothing
    %>
    <%end if%>
    <%
    Dim Gallery
    Dim Gallery_numRows

    Set Gallery = Server.CreateObject("ADODB.Recordset")
    Gallery.ActiveConnection = MM_Admin_STRING
    Gallery.Source = "SELECT Titolo, Username, Foto,Id_Im,Id_Ut,St_Calendario FROM Anagrafica_Immagini WHERE St_Attivo='S' ORDER BY Nr DESC"
    Gallery.CursorType = 0
    Gallery.CursorLocation = 2
    Gallery.LockType = 1
    Gallery.Open()

    Gallery_numRows = 0
    %>

    <%
    ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

    Dim Gallery_total
    Dim Gallery_first
    Dim Gallery_last

    ' set the record count
    Gallery_total = Gallery.RecordCount

    ' set the number of rows displayed on this page
    If (Gallery_numRows < 0) Then
    Gallery_numRows = Gallery_total
    Elseif (Gallery_numRows = 0) Then
    Gallery_numRows = 1
    End If

    ' set the first and last displayed record
    Gallery_first = 1
    Gallery_last = Gallery_first + Gallery_numRows - 1

    ' if we have the correct record count, check the other stats
    If (Gallery_total <> -1) Then
    If (Gallery_first > Gallery_total) Then
    Gallery_first = Gallery_total
    End If
    If (Gallery_last > Gallery_total) Then
    Gallery_last = Gallery_total
    End If
    If (Gallery_numRows > Gallery_total) Then
    Gallery_numRows = Gallery_total
    End If
    End If
    %>

    <%
    ' *** Recordset Stats: if we don't know the record count, manually count them

    If (Gallery_total = -1) Then

    ' count the total records by iterating through the recordset
    Gallery_total=0
    While (Not Gallery.EOF)
    Gallery_total = Gallery_total + 1
    Gallery.MoveNext
    Wend

    ' reset the cursor to the beginning
    If (Gallery.CursorType > 0) Then
    Gallery.MoveFirst
    Else
    Gallery.Requery
    End If

    ' set the number of rows displayed on this page
    If (Gallery_numRows < 0 Or Gallery_numRows > Gallery_total) Then
    Gallery_numRows = Gallery_total
    End If

    ' set the first and last displayed record
    Gallery_first = 1
    Gallery_last = Gallery_first + Gallery_numRows - 1

    If (Gallery_first > Gallery_total) Then
    Gallery_first = Gallery_total
    End If
    If (Gallery_last > Gallery_total) Then
    Gallery_last = Gallery_total
    End If

    End If
    %>

    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = NRecord
    Repeat1__index = 0
    Gallery_numRows = Gallery_numRows + Repeat1__numRows
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    <meta name="Description" content="NewLine Agency, Portale dedicato a fotografi e modelle, makeup artist e tutto il mondo della fotografia" />
    <meta name="Keywords" content="Fotografia,Photography,Foto,Photo,Nude,Nu do,Glamour,Ritratto,Portraits,Fine Art,Portfolio Personale,Luca,Fotografo, lucabphoto, Andrea Pizzal, Torino, Caorle, Book, Nudo Artistico, Barbera, Pizzal, Portale, Modelle, Fotografi, Portale Modelle, Portale Fotografi, Makeup, MUA, Location, Servizi Fotografici" />
    <meta name="ROBOTS" content="INDEX,FOLLOW" />
    <title>NewLine Agency</title>


    <link href="../Css/Style_Public.css" rel="stylesheet" type="text/css" />

    </head>


    <%if (Gallery.BOF And Gallery.EOF) Then%>
    <div align="center"><span class="carattere_10">Nessuna foto presente </span></div>
    <%end if%>
    <%if (not Gallery.BOF And not Gallery.EOF) Then%>
    <%Gallery.Move (VP-1)*NRecord %>
    <%end if%>
    <% if Gallery.EOF then %>
    <%response.Redirect("ElencoFoto.asp?P=1")%>
    <%end if%>
    <%
    While ((Repeat1__numRows <> 0) AND (NOT Gallery.EOF))
    %>
    <div id="thumb_immagini">
    <table width="130" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td height="102" colspan="2" align="center" valign="middle">

    <table width="95" height="95" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image:url(../public/Images/S_<%=(Gallery.Fields.Item("Foto").Value)%>); background-position:center; background-repeat:no-repeat;">
    <tr>
    <td align="center" valign="middle">
    ">[img]../Admin_Images/Cornici/Cornice_95_Cal_<%=(Gallery.Fields.Item([/img].png" alt="Cornice" width="95" height="95" border="0" /></td>
    </tr>
    </table>

    </td>
    </tr>
    <tr>
    <td width="105" height="20" align="left" valign="middle" class="carattere_01"><% titolo_tagliato = taglio (Gallery.Fields.Item("Titolo").Value, 17) %>
    <% response.Write(titolo_tagliato) %> </td>
    <td width="25" rowspan="2" align="right" valign="middle">">[img]../Admin_Images/Bottoni/But_Entra_Scheda.gif[/img]</td>
    </tr>
    <tr align="left" valign="middle">
    <td height="20" valign="middle" class="thumb_02"><span class="carattere_03">By:</span> <span class="utente_FO">"><%=(Gallery.Fields.Item("Username").Value)%></span></td>
    </tr>
    </table>
    </div>
    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    Gallery.MoveNext()
    Wend
    %>

    <table width="720" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="720" height="30" align="right" valign="bottom">
    <% pagine Gallery_total, NRecord
    %>
    <%
    Dim x
    x=0
    while x<nPag%>
    <%if int(Gallery_total/Nrecord)>0 then%>
    <%if int(VP)<>(x+1) then%>
    <span class="registrazione_04"><%=(x+1)%></span>
    <%else%>
    <%if (Gallery_total)>20 then%>
    <span class="registrazione_01"><%=(x+1)%></span>
    <%end if%>
    <%end if%>
    <%end if%>
    <%x = x +1
    wend
    %>
    </td>
    </tr>
    </table>
    </html>
    <%
    Gallery.Close()
    Set Gallery = Nothing
    %>


    Questo e' il file incluso:

    <%' calcolo pagine numeriche
    Dim nPag
    nPag = 1
    function pagine (recTot, recPag)

    nDec = recTot / recPag
    nInt = int(nDec)
    if nDec - nInt > 0 then
    nPag= nInt + 1
    else
    nPag = nInt
    end if

    end function
    %>

    Ho eliminato parte del body senno superavo il numero di caratteri ma il codice c'e' tutto
    Grazie per l'attenzione

  4. #4
    e l'errore a quale riga si verifica?

  5. #5
    Purtroppo quando viene generato l'errore non mi dice la riga, andando per esclusione ho individuato che eliminando questo pezzo :

    <%Gallery.Move (VP-1)*NRecord %>

    non vi e' piu' l'errore ma ovviamente non mostra piu' le 20 foto per ogni pagina

    per capirci meglio :

    La pagina della galleria foto (quella che ho copiato e incollato) visualizza tutte le 815 foto presenti nel database (MySQL) e vengono suddivise in 41 pagine da 20 foto caduna, le pagine da 1 a 12 non danno nessun errore appena clicco la pagina 13 salta fuori l'errore.


    Invece la pagina dei risultati ricerca utenti, visualizza per esempio 37 utenti divisi in 2 pagine, ma in questo caso l'errore su prensenta già alla 2° pagina.

  6. #6
    imparaima a fare un po' di debug

    al posto di

    <%Gallery.Move (VP-1)*NRecord %>

    metti

    <%
    myMove=(VP-1)*NRecord
    Response.Write "
    MaGGico myMove..." & myMove & "
    "
    Response.Flush
    Gallery.Move myMove
    %>


    poi posta quello che viene a video

  7. #7
    Utente di HTML.it L'avatar di wallrider
    Registrato dal
    Apr 2003
    Messaggi
    2,755
    e dopo la premiatissima maGGica query, il maGGico mymove
    RIP Cicciobenzina 9/11/2010

    "Riseminaciceli, i ceci nell'orto"

  8. #8
    l'importante è essere maGGico!

  9. #9
    Ed ecco il risultato

    MaGGico myMove...240

    Active Server Pages error 'ASP 0115'

    Unexpected error

    /Pub_Gallery/ElencoFoto.asp

    A trappable error (C0000005) occurred in an external object. The script cannot continue running.

  10. #10
    quanti record hai nel recordset?

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.