Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560

    errore 'loop' without 'do'

    ho inserito queste righe:
    codice:
    %>
    [img]<%= Path_IMG & Img_NonDisponibile_G %>[/img]
    <%
    									
    else
    	
    while not rs.eof
    mi da questo errore:

    Microsoft VBScript compilation error '800a040e'

    'loop' without 'do'

    /Default.asp, line 375

    Loop
    ^

    dove sbaglio?

    codice:
    <%
    								'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
    								'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
    								cont=1
    								Do While iRecordsShown < iPageSize And Not objRS.EOF
    									Dim Rig, bg
    									Rig = Rig + 1
    									If Rig Mod 2 = 0 then
    										bg = "#E4E4E4"
    									Else
    										bg = "#ccccff"	
    									End if %>	
    									<% 
    									strSql="select top 1 * from FotoProdotti where idprodotto=" & objRS("id") & " order by id desc"  
    									'response.write(strSql): response.end()
    									set rs=conn.execute(strSql)
    									dim path_foto
                                        path_foto="/public/"
                                        if not rs.eof then 
    									%>
    									[img]<%= Path_IMG & Img_NonDisponibile_G %>[/img]
    									<%
    									
    									else
    	
    	                                while not rs.eof
    									
    									nomeFoto = rs("nomeFoto")
    									
    									set rs=nothing
    									
    									strSql="select * from Utenti where id=(select iduser from user_prodotti where idprodotto=" & objRS("id") & ") "
    
    								set rs=conn.execute(strSql)
    								
    								
    								'---Assegno e stampo a video
    									If Not rs.EOF Then
    										nome = rs("nome")
    										citta = rs("citta")
    										indirizzo = rs("indirizzo")
    										telefono = rs("telefono")
    										email = rs("email")
    										piva = rs("piva")
    										end if
    								rs.close  
    								set rs=nothing
    								'***** calcolo il percorso dell'immagine da stampare
    	dim path_img_to_display
    	
    	If path_foto & nomeFoto <> "" Then
           path_img_to_display = path_foto & nomeFoto
       Else
           path_img_to_display = Path_IMG & Img_NonDisponibile_G
       End If
    %>
    
    <tr>
        <td><% nomefoto=""
    								Cont = Cont + 1
    									'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB
    									iRecordsShown = iRecordsShown + 1
    									objRS.MoveNext
    								Loop
    								'PULIZIA DEGLI OGGETTI ADO
    								objRS.Close
    								Set objRS = Nothing
    								%>
    								
    								<%End if%>
    			<%If ipagecount <> 1 Then%></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        </tr>
      <tr>
        <td colspan="6"><font face="verdana" size="1" color="#000000">
    							<center>[
    							<%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%>
    								Prima
    							<%end if%>
    							<%if iPageCurrent > 1 then%>
    								Precedente
    							<%end if%>
    							<%if iPageCount > 2 then
    								if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2
    								if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2
    							else
    								da_pag = 1
    								fino_a_pag = iPageCount
    							end if%>
    							<%for i = da_pag to fino_a_pag%>
    								<%if i = iPageCurrent then%>
    									<font color="black" size="2"><%=i%></font>
    								<%else%>	
    									<%=i%>
    								<%end if%>	
    							<%next%>
    							<%if iPageCurrent > 0 and iPageCurrent < iPageCount then%>
    								Successiva
    							<%end if%>	
    							<%if iPageCurrent+1 < iPageCount then%>
    								Ultima
    							<%end if%>	
    							]</center>
    						</font></td>
      </tr>
      <tr>
        <td colspan="6"><font face="verdana" size="0.5" color="#333333">
    							<center>
    
    							Pagina
    								<font color="#000000"><%=iPageCurrent%></font>
    								di
    								<font color="#000000"><%=iPageCount%></font>
    							</center>
    							</font>
    						  
    
    <font face="verdana" size="0.5" color="#333333">
    					          <%end if%>
    	                      <%
    			objConn.Close
    			Set objConn = Nothing
    			%>
    </font></p></td>
      </tr>

  2. #2
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    nessuno sa? VVoVe:

  3. #3
    tanti gravi errori

    il while si imposta con il do quindi la sintassi corretta è:

    do while not rs.eof


    il secondo errore e che setti l'rs del ciclo di while a nothing quindi al secondo giro il while và in crisi perchè non trova più instaziato l'rs di partenza.

    nel while inoltre tu assegno di nuovo l'RS e lo passi in loop quindi ovviamente l'intero ciclo si frega.

    Non ho visto l'end if dell' else prima del ciclo di while
    Non ho paura dei miei pensieri, ma ho paura ad esprimerli.
    La libertà d'espressione oggi, potrebbe diventare prigionia del corpo domani.

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.