
error de sintaxis en insert into
Publicado por jhoannyjg (7 intervenciones) el 20/06/2016 20:17:49
saludos estoy realizando un programa en donde tomo datos de un listview y unos textbox para guardarlo en access 97 pero me dice que el error es un error de sintaxis en el insert into. aqui les dejo el codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Private Sub cmdguardar_Click()
Dim aux, aux1, aux2, aux3, aux4, aux5 As String
Dim A, B As Integer
If txtnum.Text <> "" And txtrazon.Text <> "" And txtcedurif.Text <> "" And txtdireccion.Text <> "" And txttelefono.Text <> "" And ListView1.ListItems.Count > 0 Then
Conexion
For A = 1 To ListView1.ListItems.Count
aux = ListView1.ListItems(A)
For B = 1 To 5
If B = 1 Then: aux1 = ListView1.ListItems(A).SubItems(B)
If B = 2 Then: aux2 = ListView1.ListItems(A).SubItems(B)
If B = 3 Then: aux3 = ListView1.ListItems(A).SubItems(B)
If B = 4 Then: aux4 = ListView1.ListItems(A).SubItems(B)
If B = 5 Then: aux5 = ListView1.ListItems(A).SubItems(B)
Next B
abc.Execute "insert into registro(fecha,n,num,razon,cerif,direccion,telefono,calibre,perfil,tamano,precio,cantidad,monto,global)VALUES ('" & DTPicker1 & "','" & txtn.Text & "','" & txtnum.Text & "','" & txtrazon.Text & "','" & txtcedurif.Text & "','" & txtdireccion.Text & "','" & txttelefono.Text & "','" & aux & "','" & aux1 & "','" & aux2 & "','" & aux3 & "','" & aux4 & "','" & aux5 & "')"
Next A
abc.Close
mayor
MsgBox "INFORMACION ALMACENADA!!"
End If
End Sub
Valora esta pregunta


0