Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 16
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2006
    Messaggi
    860

    errore secondo voi perchè?

    salve ragazzi,

    questo codice se mando in responsewrite la query di update ciclica nel for mi visualizza tante query quanti i campi checkbox del form selezionati quindi da 1 a x ma tolto il response.write e mandato in esecuzione l'execute appunto mi da errore e onestam,ente non capisco perchè... :master:

    codice:
    If (cint(flag)=0) then
      'apro il db x aggiornare il valore
      set myConn = server.CreateObject("ADODB.Connection")
      dim strConnDb
      strConnDb = ""
      strConnDb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & server.mappath("/mdb-database/clienti.mdb")  
      myConn.Open(strConnDb)
    
      for i=0 to ubound(Vettore)
        NomeCheck="Check" & Vettore(i)
        ValoreCheck= request(NomeCheck)
        Posizione=Vettore1(i)
    
        'eseguo i controlli e l'update
        dim strInsertDati
        strInsertDati=""
    	if (Procedura="Svuota Cestino") then
          NuovoStato = "Eliminato"
          if (ValoreCheck="on") then
    	    If (Posizione="M") Then
              strInsertDati="update Messaggi set VisMit=':1:' where id=" & Vettore(i) & ""
            else
              strInsertDati="update Messaggi set VisDes=':1:' where id=" & Vettore(i) & ""
    	    end if
    	  else
    	  end if
        end if
        if (Procedura="Ripristina Messaggi") then	
          NuovoStato = "Si"
          if (ValoreCheck="on") then
    	    If (Posizione="M") Then
              strInsertDati="update Messaggi set VisMit=':1:' where id=" & Vettore(i) & ""
            else
              strInsertDati="update Messaggi set VisDes=':1:' where id=" & Vettore(i) & ""
    	    end if
    	  else
    	  end if
        end if 
    	strInsertDati=replace(strInsertDati,":1:",formatta_sql(cstr(Nuovostato)))
        myConn.Execute(strInsertDati)
      next
      myConn.Close
      set myConn=nothing
    
      response.redirect("Mess_cestino.asp")
    else
      response.redirect("Mess_cestino.asp?Errore=" & flag)
    end if
    l'errore mi cade proprio sulla riga dell'execute ed è:

    Microsoft JET Database Engine error '80040e0c'

    Command text was not set for the command object.

    /Mess_ripristinaecancella.asp, line 85


    grazie
    Linux Inside

  2. #2
    Utente di HTML.it L'avatar di viki1967
    Registrato dal
    Feb 2003
    Messaggi
    1,757
    A S P : tutto il resto è noia...
    L I N U X : forse mi "converto"...

  3. #3
    cmq, standing ovation per il titolo del thread

  4. #4
    Utente di HTML.it
    Registrato dal
    Feb 2006
    Messaggi
    860
    tecnicasmente hai ragione, però il fatto è che se la query è corretta non vedo perchè mi debba errare l'esecuzione...

    codice:
    update Messaggi set VisDes='Eliminato' where id=17
    update Messaggi set VisDes='Eliminato' where id=16
    update Messaggi set VisDes='Eliminato' where id=15
    update Messaggi set VisDes='Eliminato' where id=19
    update Messaggi set VisMit='Eliminato' where id=26
    update Messaggi set VisDes='Eliminato' where id=4
    update Messaggi set VisMit='Eliminato' where id=27
    update Messaggi set VisDes='Eliminato' where id=11
    update Messaggi set VisDes='Eliminato' where id=21
    update Messaggi set VisDes='Eliminato' where id=18
    update Messaggi set VisMit='Eliminato' where id=25
    update Messaggi set VisMit='Eliminato' where id=22
    update Messaggi set VisDes='Eliminato' where id=5
    update Messaggi set VisDes='Eliminato' where id=6
    update Messaggi set VisDes='Eliminato' where id=7
    update Messaggi set VisDes='Eliminato' where id=8
    update Messaggi set VisDes='Eliminato' where id=9
    update Messaggi set VisDes='Eliminato' where id=12
    update Messaggi set VisDes='Eliminato' where id=13
    update Messaggi set VisDes='Eliminato' where id=14
    update Messaggi set VisDes='Eliminato' where id=2
    update Messaggi set VisDes='Eliminato' where id=20
    update Messaggi set VisDes='Eliminato' where id=1
    update Messaggi set VisMit='Eliminato' where id=35
    update Messaggi set VisMit='Eliminato' where id=54
    update Messaggi set VisMit='Eliminato' where id=96
    update Messaggi set VisMit='Eliminato' where id=101
    questo è il response sul ciclo for e cavolo è corretto almeno salvo mie amnesie...
    Linux Inside

  5. #5
    Utente di HTML.it L'avatar di viki1967
    Registrato dal
    Feb 2003
    Messaggi
    1,757
    Che DB utilizzi ?
    A S P : tutto il resto è noia...
    L I N U X : forse mi "converto"...

  6. #6
    Utente di HTML.it
    Registrato dal
    Feb 2006
    Messaggi
    860
    access
    Linux Inside

  7. #7
    Utente di HTML.it L'avatar di viki1967
    Registrato dal
    Feb 2003
    Messaggi
    1,757
    Originariamente inviato da ThePenguin
    access
    Prova una query direttamente all'interno del db access e vedi cosa accade.
    A S P : tutto il resto è noia...
    L I N U X : forse mi "converto"...

  8. #8
    Utente di HTML.it
    Registrato dal
    Feb 2006
    Messaggi
    860
    Originariamente inviato da viki1967
    Prova una query direttamente all'interno del db access e vedi cosa accade.
    emh... non ricordo come si facesse...
    Linux Inside

  9. #9
    apri il DB e vai sotto qry?

    cmq perkè fai un replace?

    non puoi inserire direttamente nella qry?
    Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?

    I'm not Jedi. I'm a guy with a lighsaber and a few questions.

  10. #10
    Utente di HTML.it
    Registrato dal
    Feb 2006
    Messaggi
    860
    intendi così:

    codice:
    strInsertDati=(strInsertDati,":1:",cstr(Nuovostato))
    Linux Inside

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.