cosa ho sbagliato????
vi posto il codice
Dim SQL As String ' COMANDO SQL A SECONDA CHE SI TRATTI DI UNA INSERT O DI UN UPDATE
Dim conferma As String ' MESSAGGIO DI CONFERMA (SECONDO LO STESSO CRITERIO DESCRITTO SOPRA)
' COME SOPRA...
Set cn2 = New ADODB.Connection
Set rs2 = New ADODB.Recordset
cn2.Open "driver={Microsoft Access Driver (*.mdb)};dbq=c:\clienti.mdb"
SQL = "UPDATE tabella SET " _
& "(codicefiscalevend, nomevend, cognomevend, datanascitavend, comunenascitavend, viaven, residenzavend, nven, telefonovend, viaac, marca, nac, modello, cilindrata, telaio, targa, dataentrata, datauscita, valutazione, prezzovendita, costomanutenzione, guadagno, agenzia, codicefiscaleac, nomeac, cognomeac, datanascitaac, comunenascitaac, residenzaac, telefonoac) " _
& "VALUES " _
& "('" & Replace(txtcodfisven.Text, "'", "''") & "', " _
& "'" & Replace(txtnomeven.Text, "'", "''") & "', " & "'" & Replace(txtcognomeven.Text, "'", "''") & "', " _
& "'" & Replace(txtdatanascitaven.Text, "'", "''") & "', " _
& "'" & Replace(txtcomuneven.Text, "'", "''") & "', " & "'" & Replace(txtvia.Text, "'", "''") & "', " _
& "'" & Replace(txtresiven.Text, "'", "''") & "', " & "'" & Replace(txtn.Text, "'", "''") & "', " _
& "'" & Replace(txttelefonoven.Text, "'", "''") & "', " & "'" & Replace(txtvia1.Text, "'", "''") & "', " _
& "'" & Replace(txtmarca.Text, "'", "''") & "', " & "'" & Replace(txtn1.Text, "'", "''") & "', " _
& "'" & Replace(txtmodello.Text, "'", "''") & "', " _
& "'" & Replace(txtcilindrata.Text, "'", "''") & "', " _
& "'" & Replace(txttelaio.Text, "'", "''") & "', " _
& "'" & Replace(txttarga.Text, "'", "''") & "', " _
& "'" & Replace(txtdataentrata.Text, "'", "''") & "', " _
& "'" & Replace(txtdatauscita.Text, "'", "''") & "', " _
& "'" & Replace(txtvalutazione.Text, "'", "''") & "', " _
& "'" & Replace(txtprezzovendita.Text, "'", "''") & "', " _
& "'" & Replace(txtcostimanutenzione.Text, "'", "''") & "', " & "'" & Replace(txtguadagno.Text, "'", "''") & "', " _
& "'" & Replace(txtagenzia.Text, "'", "''") & "', " _
& "'" & Replace(txtcodicefiscaleac.Text, "'", "''") & "', " _
& "'" & Replace(txtnomeac.Text, "'", "''") & "', " & "'" & Replace(txtcognac.Text, "'", "''") & "', " _
& "'" & Replace(txtdatanascitaac.Text, "'", "''") & "', " & "'" & Replace(txtcomunenascitaac.Text, "'", "''") & "', " _
& "'" & Replace(txtresidenzaac.Text, "'", "''") & "', " _
& "'" & Replace(txttelefonoac.Text, "'", "''") & "')"
SQL = SQL & " where cognomevend=" & txtcognomeven
conferma = "modifica effettuata con successo"
' ESEGUO REALMENTE IL COMANDO SQL CHE ARRIVA ALL'ESTERNO DELLA CONDIZIONE
cn2.Execute (SQL)
lblmessaggio.Caption = conferma
cn2.Close