Visualizzazione dei risultati da 1 a 7 su 7

Discussione: [SQL] QUERY che nn va'

  1. #1

    [SQL] QUERY che nn va'

    ragazzi mi sapete dire dove sta l'errore in questa query:
    'StrSql = "INSERT INTO clienti (codcl,nome,cognome,indirizzo,comune,cap,telfisso, telmobile,email,natoil,natoa,provincia,sesso,profe ssione,note,statocivile,hobbies,redditoannuo,altri redditi,casadiprop,altrepropimm,risparmiomensile,i nteressepf,uscita,servizibanca,investimentia,final itainvestimento,ente,agente)"
    'StrSql = StrSql & " VALUES('" & codice & "','" & IIf(nomeT.testo <> "", nomeT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(cognomeT.testo <> "", cognomeT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(indirizzoT.testo <> "", indirizzoT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(comuneT.testo <> "", comuneT.testo, "") & "',"
    'StrSql = StrSql & "'" & capT.testo & "',"
    'StrSql = StrSql & "'" & IIf(telfissoT.testo <> "", telfissoT.testo, "0") & "',"
    'StrSql = StrSql & "'" & IIf(cellT.testo <> "", cellT.testo, "0") & "',"
    'StrSql = StrSql & "'" & IIf(mailT.testo <> "", mailT.testo, "") & "',"
    'StrSql = StrSql & "'" & datanascitaT.Value & "',"
    'StrSql = StrSql & "'" & IIf(luogonascitaT.testo <> "", luogonascitaT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(provinciaT.testo <> "", provinciaT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(sessoCB.Text <> "", sessoCB.Text, "") & "',"
    'StrSql = StrSql & "'" & IIf(ProfessioneCB.Text <> "", ProfessioneCB.Text, "") & "',"
    'StrSql = StrSql & "'" & IIf(noteT.testo <> "", noteT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(StatoCivileCB.Text <> "", StatoCivileCB.Text, "") & "',"
    'StrSql = StrSql & "'" & IIf(hobbiesT.testo <> "", hobbiesT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(redditoannuoT.testo <> "", redditoannuoT.testo, "0") & "',"
    'StrSql = StrSql & "'" & IIf(altriredditiT.testo <> "", altriredditiT.testo, "0") & "',"
    'StrSql = StrSql & "'" & casadipropCH.Value & "',"
    'StrSql = StrSql & "'" & altrepropCH.Value & "',"
    'StrSql = StrSql & "'" & IIf(risparimomensileT.testo <> "", risparimomensileT.testo, "0") & "',"
    'StrSql = StrSql & "'" & IIf(interesseT.testo <> "", interesseT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(prevedeoutT.testo <> "", prevedeoutT.testo, "") & "',"
    'StrSql = StrSql & "'" & IIf(comevalutaCB.Text <> "", comevalutaCB.Text, "") & "',"
    'StrSql = StrSql & "'" & IIf(preferisceCB.Text <> "", preferisceCB.Text, "") & "',"
    'StrSql = StrSql & "'" & IIf(finalitaCB.Text <> "", finalitaCB.Text, "") & "',"
    'StrSql = StrSql & "'" & IIf(enteconilqualeT.testo <> "", enteconilqualeT.testo, "") & "',"
    'StrSql = StrSql & "'" & Base.Agente & "');"

  2. #2
    Utente di HTML.it L'avatar di darkblOOd
    Registrato dal
    Jul 2001
    Messaggi
    2,212

    non si capisce niente....

    che errore ti da?

  3. #3
    mi da errore di sintassi sull'istruzione INSERT INTO...ma cmq ho scoperto che se tolgo l'inserimento del campo note va tutto bene...eppure il campo del DB si chiama proprio come è scritto.

  4. #4
    Utente di HTML.it L'avatar di Manuweb
    Registrato dal
    Nov 2002
    Messaggi
    108
    Prova a mettere [note] tra parentesi quadre

  5. #5
    prova a farti stampare la stringa StrSql mettendo on error resume next all'inizio della pagina e vedi cosa cè che non va.
    http://www.navimel.com

    La disumanità del computer sta nel fatto che, una volta programmato(da me) e messo in funzione, FA QUEL CAZZO CHE VUOLE!!!

  6. #6
    Utente di HTML.it L'avatar di darkblOOd
    Registrato dal
    Jul 2001
    Messaggi
    2,212
    Originariamente inviato da alfdev
    mi da errore di sintassi sull'istruzione INSERT INTO...ma cmq ho scoperto che se tolgo l'inserimento del campo note va tutto bene...eppure il campo del DB si chiama proprio come è scritto.
    nel campo note hai inserito qualche virgola o apice?

  7. #7
    no.
    sai come ho risolto?
    ho fatto un campo note2 nel database e funziona tutto. Con il campo note non funziona...strano..non so perchè ma cmq è così.



    tnx

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.