Consulta comando Update
Publicado por Naireth (1 intervención) el 14/09/2018 23:19:02
Buenas tardes, necesito una ayuda en cuanto a esta consulta, he revisado toda el código referente a una carga de datos en el sistema, en este específicamente modificación de datos de los clientes ya cargados en el mismo, pero el sistema me sigue arrojando "Error de Sintaxis en comando UPDATE" y por más que lo he revisado mil veces no he podido dar con el error, quizás sea algo mínimo pero Ayuda.
Este es el código en el que error continúa, si me pueden ayudar, se los agradecería.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Dim ClientesUpdate As New OleDbCommand()
nuevaconexion = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PROGRAMA_EYT\PRUEBA_EYT.mdb")
Try
nuevaconexion.Open()
Catch ex As Exception
End Try
'****************************************************************
'Ojo cuando el campo legajo es numerico y se quiere actualizar
'& "legajo=" & "'" & txtcodigo.text & "'"
' mirar bien
'****************************************************************
'sqlstr = "update CLIENTES_EYT set " _
sqlstr = "update CLIENTES_EYT set " _
& "SERVICIO=" & "'" & txtServicio.Text & "', " _
& "APELLIDO=" & "'" & txtApellido.Text & "', " _
& "NOMBRE=" & "'" & txtNombre.Text & "', " _
& "OFICINA_N°=" & "'" & txtOficina.Text & "', " _
& "HORARIO=" & "'" & txtHorario.Text & "', " _
& "FECHA_VENCIMIENTO=" & "'" & dtpVencimientoFecha.Value & "', " _
& "PAGO=" & "'" & txtPago.Text & "', " _
& "LOCKER=" & "'" & txtLocker.Text & "', " _
& "EXTRAS=" & "'" & txtExtras.Text & "', " _
& "A_FAVOR=" & "'" & txtA_Favor.Text & "', " _
& "TOTAL=" & "'" & txtTotal.Text & "', " _
& "TELÉFONO=" & "'" & txtTelefono.Text & "', " _
& "CELULAR=" & "'" & txtCelular.Text & "', " _
& "EMAIL 1=" & "'" & txtEmail1.Text & "', " _
& "EMAIL 2=" & "'" & txtEmail2.Text & "', " _
& "EMAIL 3=" & "'" & txtEmail3.Text & "', " _
& "EMAIL 4=" & "'" & txtEmail4.Text & "', " _
& "AUTORIZA_A=" & "'" & txtAutoriza.Text & "', " _
& "VIGENCIA =" & "'" & txtVigencia.Text & "' where Id= " & txtId.Text
ClientesUpdate.CommandText = sqlstr
ClientesUpdate.Connection = nuevaconexion
ClientesUpdate.ExecuteNonQuery()
tablaclientes.Clear()
clientesda.Fill(tablaclientes)
MsgBox("Su registro se ha modificado", MsgBoxStyle.OkOnly, "Registro Modificado")
Este es el código en el que error continúa, si me pueden ayudar, se los agradecería.
Valora esta pregunta


0