Visualizzazione dei risultati da 1 a 9 su 9

Discussione: Unexpected 'Next'

  1. #1
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870

    Unexpected 'Next'

    Cosa sbaglio in questo code, perchè continua a restituire errore?:
    codice:
    For Each FileField in Form.Files.Items
    
    ................
     
    contRighe = 1
        
       Do Until Rs.Eof    
       
       If Rs("Nome") <> "" Then
       
        oRS.AddNew
        
        oRs("Nome") = Rs("Nome")                        
        oRs("Cognome")= Rs("Cognome")                  
        oRS("Email") = Form("Email")
          
        oRs.Update
        
        intCount = intCount + 1
        contRighe = contRighe + 1
          
      else 				
    rs.movenext				
    do while not rs.Eof						
    If Rs("Nome") <> "" Then								
    err=1								
    exit do						
    end if		
    Rs.movenext
    		
    loop	
    if rs.eof then
                    exit do
                end if	
    end if   
    rs.movenextloop		
    if err<>0 then 	
    exit do
    	end if 
    if err<>0 then	
    	
    Response.write "<center>Errore alla "& contRighe &"!" & "
    
    " 
    else
    Response.Write "La procedura ha avuto esito Positivo ! " & "
    
    " 
    end if
    
     next

  2. #2
    prova a scrivere

    next FileField

  3. #3
    cos' è rs.movenextloop ???

  4. #4
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    Originariamente inviato da danielsan119
    prova a scrivere

    next FileField
    Grazie, ma:
    codice:
    Microsoft VBScript compilation error '800a041f' 
    Unexpected 'Next' 
    /xxx.asp, line 197 
    
    Next FileField

  5. #5
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    cos' è rs.movenextloop ???
    un errore nel copiare il code da una pagina all'altra, adesso restituisce:
    codice:
    Microsoft VBScript compilation error '800a040f' 
    
    Invalid 'exit' statement 
    
    /xxx.asp, line 164 
    
    exit do

  6. #6
    l' exit do dovrebbe stare prima del loop

  7. #7
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    Originariamente inviato da danielsan119
    l' exit do dovrebbe stare prima del loop
    codice:
    end if   
    rs.movenext
    exit do
    loop		
    if err<>0 then
    Unexpected 'Next'

  8. #8
    allora c'è sicuramente un errore qui:

    For Each FileField in Form.Files.Items

    ................

    contRighe = 1

    Do Until Rs.Eof
    If Rs("Nome") <> "" Then
    oRS.AddNew
    oRs("Nome") = Rs("Nome")
    oRs("Cognome")= Rs("Cognome")
    oRS("Email") = Form("Email")
    oRs.Update
    intCount = intCount + 1
    contRighe = contRighe + 1
    else
    rs.movenext

    do while not rs.Eof
    If Rs("Nome") <> "" Then
    err=1

    exit do
    end if
    Rs.movenext
    loop

    if rs.eof then
    exit do
    end if

    end if

    rs.movenext
    loop

    if err<>0 then
    exit do
    end if

    if err<>0 then
    Response.write "<center>Errore alla "& contRighe &"!" & "

    "
    else
    Response.Write "La procedura ha avuto esito Positivo ! " & "

    "
    end if
    next

    se non ho ordinato male i vari cicli, in quel punto ci va un exit for e non un exit do, in quanto il ciclo do lo hai già finito sopra con le righe rs.movenext e loop.
    Matrix è ovunque, è intorno a noi, anche adesso nella stanza in cui siamo. È quello che vedi quando ti affacci alla finestra o quando accendi il televisore. L'avverti quando vai al lavoro, quando vai in chiesa, quando paghi le tasse. È il mondo che ti è stato messo dinanzi agli occhi, per nasconderti la verità.

  9. #9
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    codice:
    For Each FileField in Form.Files.Items 
    
    ................ 
    
    contRighe = 1 
    
    Do Until Rs.Eof 
    If Rs("Nome") <> "" Then 
    oRS.AddNew 
    oRs("Nome") = Rs("Nome") 
    oRs("Cognome")= Rs("Cognome") 
    oRS("Email") = Form("Email") 
    oRs.Update 
    intCount = intCount + 1 
    contRighe = contRighe + 1 
    else 
    rs.movenext 
    
    do while not rs.Eof 
    If Rs("Nome") <> "" Then 
    err=1 
    
    exit do 
    end if 
    Rs.movenext 
    loop 
    
    if rs.eof then 
    exit do
    end if 
    
    end if 
    
    rs.movenext 
    loop 
    
    if err<>0 then 
    exit for     
    end if 
    if err<>0 then 
    Response.write "<center>Errore alla "& contRighe &"!" & "
    
    " 
    else 
    Response.Write "La procedura ha avuto esito Positivo ! " & "
    
    " 
    end if 
    next
    purtroppo non cambia nulla... :master:

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.