Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135

    Problema con query Update

    Ciao, mi spiegate perchè se eseguo questa query, poi quando voglio richiamare un campo del db mi restituisce errore?:

    codice:
    strID = request.querystring("id")
    
    str_update = "UPDATE TabellaAccess SET "
    str_update = str_update & " inoltrata = true "
    str_update = str_update & " WHERE id = " & strID
    Set RS = conn.execute(str_update)
    
    strVar = RS("altro_campo_del_db")
    Error Type:
    ADODB.Recordset (0x800A0CC1)
    Item cannot be found in the collection corresponding to the requested name or ordinal.

    Sulla riga dei strVar. :master:
    Lo Stato dà un posto. L’impresa privata dà un lavoro. – Indro Montanelli

  2. #2
    Utente di HTML.it L'avatar di Joe Taras
    Registrato dal
    Nov 2003
    residenza
    Taranto
    Messaggi
    955

    Re: Problema con query Update

    Originariamente inviato da [trodat]
    Ciao, mi spiegate perchè se eseguo questa query, poi quando voglio richiamare un campo del db mi restituisce errore?:

    codice:
    strID = request.querystring("id")
    
    str_update = "UPDATE TabellaAccess SET "
    str_update = str_update & " inoltrata = true "
    str_update = str_update & " WHERE id = " & strID
    Set RS = conn.execute(str_update)
    
    strVar = RS("altro_campo_del_db")
    Error Type:
    ADODB.Recordset (0x800A0CC1)
    Item cannot be found in the collection corresponding to the requested name or ordinal.

    Sulla riga dei strVar. :master:
    Perché devi fare una SELECT per leggere i campi e non una UPDATE. Insomma credo hai bisogno di 2 query

  3. #3
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135

    Re: Re: Problema con query Update

    Originariamente inviato da Joe Taras
    Perché devi fare una SELECT per leggere i campi e non una UPDATE. Insomma credo hai bisogno di 2 query
    D'accordo ci avevo pensato, ma allora la differenza qual'è tra:

    codice:
    Set objRS = conn.execute(str_update)
    e

    codice:
    conn.execute(str_update)
    per l'esecuzione delle query di update o insert ?

    Lo Stato dà un posto. L’impresa privata dà un lavoro. – Indro Montanelli

  4. #4
    che una query di insert restituisce un recordset, quelle di update/delete no

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.