in
La comunità italiana dedicata a Sviluppatori e Architetti IT delle piattaforme Windows

error '80040e14' Number of query values and destination fields are not the same

Ultimo messaggio ricevuto il 09-08-2005 16.40 da theFool. 6 risposta(e).
Pagina 1 di 1 (7 elemento/i)
Ordina messaggi: Precedente Successivo
  • 09-08-2005 11.27

    Crying [:'(] error '80040e14' Number of query values and destination fields are not the same

    Sono sempre io...

    ciao, ho risolto un problema, ma eccone un altro! Non ce la faccio più, invece di essere in ferie....

    Allora ho questo errore:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same

    Verificando la stringa dell'INSERT sul web:

    INSERT INTO tbl_orders (order_ID, order_CustomerID, order_Tax, order_Shipping, order_Total, order_Status, order_ShipMeth_ID, order_Address1, order_Address2, order_City, order_Zip, order_Country, order_State, order_transactionID, order_Date, order_ShipName) VALUES ('110820URJXQKU1', '140758PMESMGPVK-07-11-92', 0, 17, 26,6, '1', 75, 'piazza Montessori 16', '', 'Crotone', '88900', 'IT', 'KR ', '326590450', #09/08/2005 11:13:20#,'Rossana Garena');

    Mentre il codeice INSERT è il seguente:

    query = "INSERT INTO tbl_orders " &_
         "(order_ID, order_CustomerID, order_Tax, " &_
         "order_Shipping, order_Total, order_Status, " &_
         "order_ShipMeth_ID, order_Address1, order_Address2, " &_
         "order_City, order_Zip, order_Country, " &_
         "order_State, order_transactionID, order_Date, order_ShipName) " &_
        "VALUES (" &_
        "'" & orderID & "', " & "'" & strCustomerID & "', " & intTaxAmount & ", " &_
        intShipTotal & ", " & intOrderTotal & ", " & "'" & OrderStatusID & "', " &_
        intShipPref & ", " & "'" & rs("cst_ShpAddress1") & "', " & "'" & rs("cst_ShpAddress2") & "', " &_
        "'" & rs("cst_ShpCity") & "', " & "'" & rs("cst_ShpZip") & "', " & "'" & rs("country_Code") & "', " &_
        "'" & rs("stprv_Code") & "', " & "'" & transactionID & "', " &  cwMakeSQLDate(Now(),True) &  ",'" & rs("cst_ShpName") & "');"

    Spero ci sia ancora qualcuno che sappia dirmi come fare.

    Ciao

     

    • Log
  • 09-08-2005 12.06 In risposta a

    • theFool
    • Utente Top 10
    • Registrato il 13-07-2005
    • Piacenza
    • Messaggi 127

    Wink [;)] Re: error '80040e14' Number of query values and destination fields are not the same

    ciao... anch'io sono sempre io!

    il problema che viene segnalato (mancata corrispondenza tra il numero dei campi e quello dei  valori) secondo me dipende dal fatto che uno dei valori numerici presenti della query sql segue la notazione italiana tale x cui le cifre decimali sono separate da quelle intere mediante il simbolo ,

    Il valore in questione è 26,6 e corrisponde alla variabile intOrderTotal; Purtroppo l'interprete sql lo interpreta come 2 valori numerici distinti: 26 e 6

    Per risolvere il problema è basta usare il simbolo . (e quindi 26.6)

     

     

     

    • Log
  • 09-08-2005 12.31 In risposta a

    Re: error '80040e14' Number of query values and destination fields are not the same

    Speravo ci fossi, sei il solo ad aiutarmi!!

    Ma la modifica del punto al posto della virgola dove deve essere apportata?

    Nel database? o nel codice di qualche pagina?

    • Log
  • 09-08-2005 12.51 In risposta a

    • theFool
    • Utente Top 10
    • Registrato il 13-07-2005
    • Piacenza
    • Messaggi 127

    Re: error '80040e14' Number of query values and destination fields are not the same

    il db è ok, invece devi modificare il codice che compila la query; puoi segliere due strade:

    1- recuperare il valore corretto già dalla request, ovvero effettuare i controlli/conversioni sul client;

    2- operare le conversioni del caso sul server con una funz tipo quella che già ti mostrai (rieccola... a volte ritornano!):

    Function num2sql( n )
    num2sql = replace(CStr(n),",",".")
    End Function

    e quindi qs del tipo:

    query = "INSERT INTO tbl_orders (order_Total) VALUES(" & num2sql(intOrderTotal) & ")"

     

    ATTENZIONE!

    Il problema che ti capita, potrebbe tornare alla ribalta se la variabile intOrderTotal contentesse eventuali separatori delle migliaia (es. 1.234.567,89   =  1234567.89)

     

    ciao, vado a mangiare la pappa... torno sulla tastiera per le 1430

    bye bye

    Big Smile [:D]

    • Log
  • 09-08-2005 14.15 In risposta a

    Tongue Tied [:S] Re: error '80040e14' Number of query values and destination fields are not the same

    Innanzitutto buon pranzo!

    Non ci sto più con la testa! Ora mi dà quest' errore:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

     

    Sul web si visualizza:

    INSERT INTO tbl_orders (order_ID, order_CustomerID, order_Tax, order_Shipping, order_Total, order_Status, order_ShipMeth_ID, order_Address1, order_Address2, order_City, order_Zip, order_Country, order_State, order_transactionID, order_Date, order_ShipName) VALUES ('140832MKCPJDMT', '140758PMESMGPVK-07-11-92', , , , '1', 75, 'piazza Montessori 16', '', 'Crotone', '88900', 'IT', 'KR ', '326593081', #09/08/2005 14:15:32#,'Rosanna Gigliotti');

    Credimi, sto diventando matta!!
    Con queste cose già impostate non voglio averci più niente da fare!

     

    • Log
  • 09-08-2005 14.43 In risposta a

    Big Smile [:D] Re: error '80040e14' Number of query values and destination fields are not the same

    SEMBRA FUNZIONI CORRETTAMENTE!!!

    SPERO SIA TUTTO GIUSTO. HO RIVISTO TUTTO DA CAPO SEGUENDO TUTTI I TUOI SUGGERIMENTI.

    ORA FUNZIONA, SE NON MI "VEDI" COMPARIRE SUL FORUM ENTRO 48 ORE E' TUTTO OK..

    GRAZIE GRAZIE GRAZIE

     

    • Log
  • 09-08-2005 16.40 In risposta a

    • theFool
    • Utente Top 10
    • Registrato il 13-07-2005
    • Piacenza
    • Messaggi 127

    Re: error '80040e14' Number of query values and destination fields are not the same

    Bella storia, brava! Cool [H]

     

     

    • Log
Pagina 1 di 1 (7 elemento/i)
Prelevato da http://www.devspy.com/forums/t/3911.aspx
DevSpy.com 6.0 © 2001-2008 - Alcuni Diritti Riservati
Salvo diversa indicazione, tutti i contenuti sono pubblicati sotto licenza "Creative Commons Attribution-Share Alike 3.0"