Pagina 3 di 3 primaprima 1 2 3
Visualizzazione dei risultati da 21 a 27 su 27

Discussione: ElseIf non rispettata.

  1. #21
    fra, e' un problema di logica! immagino che anche in quest'ultimo caso siano entrambe vere. devi fare in modo di controllare condizioni che siano tutte diverse tra loro.

  2. #22
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    queste sono le condizioni che ho previsto:
    codice:
    if CAT = 0 and UOAT = 0 and strDenominazione = "TUTTI" then
    
     elseif CAT = 0 and stato = "TUTTE" and uoat = 0 then
    
      elseif STATO <> "TUTTE" and CAT <> 0 then
    
       elseif CAT <> 0 and uoat <> 0 and strDenominazione <> "TUTTI" then
    
        elseif CAT <> 0 and uoat <> 0 then
    
          elseif STATO <> "TUTTE" and uoat <> 0 then
    
         elseif STATO <> "TUTTE" then
    
        elseif CAT <> 0 then
    
       elseif UOAT <> 0 then
    
      elseif CAT = 0 and UOAT = 0 and strDenominazione <> "TUTTI" then
    
     end if

  3. #23
    tra queste ce ne sono alcune che possono essere vere contemporaeamente? se si', devi introdurre qualcosa che faccia in modo che cio' non accada. questo perche' con la elseif ha precedenza la condizione che viene verificata per prima

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

    Delle condizioni solo quelle che danno problemi si verificano contemporaneamente... non ho idea cosa posso inventarmi...

  5. #25
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    Dunque... la logica di opt...

    ho inserito questa condizione che se 'vera' esegue questa query:
    codice:
    if CAT = 0 and UOAT = 0 and strDenominazione <> "TUTTI" and STATO = "TUTTE" then
    Set rs = DBconn.Execute("SELECT * FROM Analisi WHERE cabina = '"& strDenominazione &"' ORDER BY CAT ASC")
    ma la query restituisce:
    ADODB.Recordset error '800a0bcd'

    Il record corrente corrisponde all'inizio o alla fine del file oppure è stato eliminato. Per eseguire l'operazione richiesta è necessario disporre di un record corrente.

    /s_xls.asp, line 39
    perchè? :master:

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

    Risolto grazie alla logica e naturalmente a opt !!!
    codice:
     if CAT = 0 and UOAT = 0 and strDenominazione <> "TUTTI" and STATO = "TUTTE" then
    ...
    
    
    elseif CAT = 0 and UOAT = 0 and strDenominazione = "TUTTI" AND STATO <> "TUTTE" then
    ...
    
    
    elseif CAT = 0 and UOAT = 0 and CP = "TUTTI" then
    ...
    
    
    elseif CAT = 0 and stato = "TUTTE" and uoat = 0 then
    ...
    
    
    elseif STATO <> "TUTTE" and CAT <> 0 then
    ...
    
    
    elseif CAT <> 0 and uoat <> 0 and cp <> "TUTTI" then
    ...
    
    
    elseif CAT <> 0 and uoat <> 0 then
    ...
     
    
    elseif STATO <> "TUTTE" and uoat <> 0 then
    ...
    
    
    elseif CAT <> 0 then
    ...
    
    
    elseif UOAT <> 0 then
    ...
    
    
    end if

  7. #27

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.