Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12

Discussione: error '800a041f'

  1. #1

    error '800a041f'

    Salve a tutti,

    ho un piccolo problema con un Next, infatti mi esce il seguente errore:

    Microsoft VBScript compilation error '800a041f'

    Unexpected 'Next'

    /prova2.asp, line 351

    Next
    ^

    Posto il codice dell'area interessata:

    <%
    Set rscommenti = Server.CreateObject("ADODB.Recordset")

    If rsblog.EOF Then
    Response.Write(msg)
    Response.End()
    Else
    totale = rsblog.RecordCount

    For i = 1 To intRecordPerPage
    If rsblog.EOF Then Exit For
    strSQL = "SELECT Count(commenti.blog_id) AS numerocommenti "
    strSQL = strSQL & "FROM commenti "
    strSQL = strSQL & "WHERE commenti.blog_id = " & CLng(rsblog("blog_id")) & ";"
    rscommenti.Open srtSQL, adoCon
    %>
    <table width="85%" border="0" cellpadding="2" cellspacing="0" align="center" class="tablemenu">
    <tr>
    <td width="70%">
    <%= UCase(rsblog("blog_titolo")) %>di
    <%If rsblog("blog_email") <> "" Then
    Response.Write("" & rsblog("blog_autore") & "")
    Else
    Response.Write(rsblog("blog_autore"))%>

    </td>
    <td align="right">
    <%= rsblog("data") %>alle<%= FormatDateTime(rsblog("ora"), vbShortTime) %>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <div class="hrgreen">[img]public/area_riservata/Blog/immagini/spacer.gif[/img]</div>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <p align="justify">
    <%srtText = rsblog("blog_testo")
    Response.Write(anteprima(strText, 40))%>
    </p>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <div class="hrgreen">[img]public/area_riservata/Blog/immagini/spacer.gif[/img]</div>
    </td>
    </tr>
    <tr>
    <td>
    <%If CBool(rsblog("commenti")) = True Then%>
    &month=<%= iMonth %>&year=<%= iYear %>&giorno=<%= giorno %>&archivio=<%= archivio %>&#commento" target="_top">aggiungi commento
    <%If NOT rscommenti.EOF Then
    Response.Write("[ commenti presenti " & rscommenti("numerocommenti") & "]")
    Else
    Response.Write("[ commenti presenti 0 ]")
    End If%>
    <%End If%>
    </td>
    <td align="right" class="back2">
    [img]public/area_riservata/Blog/immagini/dettagli.gif[/img]&month=<%= iMonth %>&year=<%= iYear %>&giorno=<%= giorno %>&archivio=<%= archivio %>" target="_top">leggi tutto
    </td>
    </tr>
    </table>




    <%rscommenti.Close
    rsblog.MoveNext
    Next
    End If%>
    Amor Vincit Omnia

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Questo

    rsblog.MoveNext

    richiede un loop del recordset che non mi pare di vedere.
    Qualcosa tipo

    do while not rsblog.EOF

    Roby

  3. #3
    Originariamente inviato da Roby_72
    Questo

    rsblog.MoveNext

    richiede un loop del recordset che non mi pare di vedere.
    Qualcosa tipo

    do while not rsblog.EOF

    Roby
    Hai ragione ho controllato e non c'è nessun loop.

    Ho provato ad inserire il while do qui:

    codice:
    									rsblog.PageSize = intRecordsPerPage
    									
    									If NOT rsblog.EOF Then rsblog.AbsolutePage = page
    									  
    									Set rscommenti = Server.CreateObject("ADODB.Recordset")
    									
    									If rsblog.EOF Then
    									  Response.Write(msg)
    									  Response.End()
    									Else
    									  totale = rsblog.RecordCount
    									  For i = 1 To intRecordPerPage
    									    If rsblog.EOF Then Exit For
    										Do While NOT rsblog.EOF
    										strSQL = "SELECT Count(commenti.blog_id) AS numerocommenti "
    										strSQL = strSQL & "FROM commenti "
    										strSQL = strSQL & "WHERE commenti.blog_id = " & CLng(rsblog("blog_id")) & ";"
    										rscommenti.Open srtSQL, adoCon
    									%>
    ma l'errore rimane...[/COLOR]
    Amor Vincit Omnia

  4. #4
    prova
    codice:
    ...
    If rsblog.EOF Then
    Response.Write(msg)
    Response.End()
    Else
     totale = rsblog.RecordCount
    Do While NOT rsblog.EOF
     strSQL = "SELECT Count(commenti.blog_id) AS numerocommenti "
    ....

  5. #5
    grazie fatto ma non cambia nulla...
    Amor Vincit Omnia

  6. #6
    controlla gli end if

    codice:
    <%
    Set rscommenti = Server.CreateObject("ADODB.Recordset")
    
    If rsblog.EOF Then
    Response.Write(msg)
    Response.End()
    Else
    totale = rsblog.RecordCount
    
    For i = 1 To intRecordPerPage
    If rsblog.EOF Then Exit For end if 
    strSQL = "SELECT Count(commenti.blog_id) AS numerocommenti "
    strSQL = strSQL & "FROM commenti "
    strSQL = strSQL & "WHERE commenti.blog_id = " & CLng(rsblog("blog_id")) & ";"
    rscommenti.Open srtSQL, adoCon
    %>
    <table width="85%" border="0" cellpadding="2" cellspacing="0" align="center" class="tablemenu">
    <tr>
    <td width="70%">
    <%= UCase(rsblog("blog_titolo")) %>  di 
    <%If rsblog("blog_email") <> "" Then
    Response.Write("" & rsblog("blog_autore") & "")
    Else
    Response.Write(rsblog("blog_autore")) 
    end if %>
    
    </td>
    <td align="right">
    <%= rsblog("data") %> alle <%= FormatDateTime(rsblog("ora"), vbShortTime) %>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <div class="hrgreen">[img]public/area_riservata/Blog/immagini/spacer.gif[/img]</div>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <p align="justify">
    <%srtText = rsblog("blog_testo")
    Response.Write(anteprima(strText, 40))%>
    </p>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <div class="hrgreen">[img]public/area_riservata/Blog/immagini/spacer.gif[/img]</div>
    </td>
    </tr>
    <tr>
    <td>
    <%If CBool(rsblog("commenti")) = True Then%>
    &month=<%= iMonth %>&year=<%= iYear %>&giorno=<%= giorno %>&archivio=<%= archivio %>&#commento" target="_top">aggiungi commento
    <%If NOT rscommenti.EOF Then
    Response.Write(" [ commenti presenti " & rscommenti("numerocommenti") & "]")
    Else
    Response.Write(" [ commenti presenti 0 ]")
    End If%>
    <%End If%>
    </td>
    <td align="right" class="back2">
    [img]public/area_riservata/Blog/immagini/dettagli.gif[/img] &month=<%= iMonth %>&year=<%= iYear %>&giorno=<%= giorno %>&archivio=<%= archivio %>" target="_top">leggi tutto
    </td>
    </tr>
    </table>
    
    
    
    
    <%rscommenti.Close
    rsblog.MoveNext
    Next
    End If%>
    prova così

  7. #7
    Probabilmente ti manca un end if da qualche parte, ma con il codice formattato nel modo in cui l'hai postato ti ci voglio a trovarlo..

    Il do while non serve, stai facendo un for/next.
    xxx

  8. #8
    Sembra averlo digerito!!!

    Ora però mi dà lo stesso tipo di errore qui:

    codice:
    									Response.Write("pagina " & page & " di " & maxpages & "</td")
    									Response.Write("<td width=""70%"" align=""center"">")
    									
    									PagStop = Block * PagesPerBlock
    									PagStart = (PagStop - PagesPerBlock) + 1
    									
    									i = 0
    									If maxpages > 1 Then
    									  For vpage = PagStart to PagStop
    									    i = i + 1
    										If Block = 1 Then
    										  i = 0
        									  If i = 1 And Block > 1 Then
    										    Response.Write("[img]public/area_riservata/blog/immagini/frecciasx.gif[/img]")
    										  End If
    										
    										  RemainingRecords = totale - (vpage * intRecordsPerPage)
    										  If RemainingRecords > 0 Then
    										    If vpage = CInt(page) Then
    										      Response.Write(vpage)
    									        Else
    										      Response.Write("" & vpage &"")
    										    End If
    										  Exit For
    								        End If
    									  
    									    If vpage = PagStop And Block > 1 And int(Block - 1) < int(Blocks) Then
    									      Response.Write("[img]public/area_riservata/blog/immagini/freccia.gif[/img]")
    									    End If
    									  Next
    									End If
    									
    									Response.Write("</td></tr></table>")%>
    Ho guardato se ho dimenticato qualche end if ma sembrano esserci tutti...
    Amor Vincit Omnia

  9. #9
    manca l'end if di
    codice:
    Response.Write("pagina " & page & " di " & maxpages & "</td")
    									Response.Write("<td width=""70%"" align=""center"">")
    									
    									PagStop = Block * PagesPerBlock
    									PagStart = (PagStop - PagesPerBlock) + 1
    									
    									i = 0
    									If maxpages > 1 Then
    									  For vpage = PagStart to PagStop
    									    i = i + 1
    										If Block = 1 Then 
    										  i = 0
        									  If i = 1 And Block > 1 Then
    										    Response.Write("[img]public/area_riservata/blog/immagini/frecciasx.gif[/img]  ")
    										  End If
    										
    										  RemainingRecords = totale - (vpage * intRecordsPerPage)
    										  If RemainingRecords > 0 Then
    										    If vpage = CInt(page) Then
    										      Response.Write(vpage)
    									        Else
    										      Response.Write("" & vpage &"")
    										    End If
    										  Exit For
    								        End If
    									  
    									    If vpage = PagStop And Block > 1 And int(Block - 1) < int(Blocks) Then
    									      Response.Write("  [img]public/area_riservata/blog/immagini/freccia.gif[/img]")
    									    End If
    									  Next
    									End If
    									
    									Response.Write("</td></tr></table>")%>

  10. #10
    se aggiungo l'end if mi restituisce il seguente errore:

    Microsoft VBScript compilation error '800a03f6'

    Expected 'End'

    /prova2.asp, line 485
    Amor Vincit Omnia

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.