Ayuda BD en VB con ADO y Access
Publicado por SirKronos (1 intervención) el 07/06/2009 18:37:15
Tengo un problema con este codigo me sale que no coiciden los tipos de datos con la expresion de criterios .... les pego el codigo de antemano muchas gracias :)
Select Case ACCION
Case EDITAR_REGISTRO
cnn.Execute "UPDATE Personas set Nombre = '" & Text1(1) & _
"', Apellido = '" & Text1(2) & _
"', Telefono = '" & Text1(3) & _
"', Direccion = '" & Text1(4) & _
"', Sexo = '" & CmbSexo.ListIndex & _
"', A2008 = '" & a1 & _
"', A2009 = '" & a2 & _
"', A2010 = '" & a3 & _
"', A2011 = '" & a4 & _
"' where Id = " & IdRegistro & ""
Case AGREGAR_REGISTRO
cnn.Execute "INSERT INTO Personas " & "(Nombre,Apellido,Telefono,Direccion,Sexo,FechaDeAlta,A2008,A2009,A2010,A2011) VALUES('" & _
Text1(1) & "','" & _
Text1(2) & "','" & _
Text1(3) & "','" & _
Text1(4) & "','" & _
CmbSexo.ListIndex & "','" & _
Check1 & "','" & _
Check2 & "','" & _
Check3 & "','" & _
Check4 & "','" & _
Format(Date, "dd/mm/yyyy") & "')"
End Select
rs.Requery
Call CargarListView(FrmPrincipal.LV, rs)
DoEvents
Unload Me
-------------------------------------------------------------------------------------------------------------------------------
Muchas gracias por su ayuda :)
Select Case ACCION
Case EDITAR_REGISTRO
cnn.Execute "UPDATE Personas set Nombre = '" & Text1(1) & _
"', Apellido = '" & Text1(2) & _
"', Telefono = '" & Text1(3) & _
"', Direccion = '" & Text1(4) & _
"', Sexo = '" & CmbSexo.ListIndex & _
"', A2008 = '" & a1 & _
"', A2009 = '" & a2 & _
"', A2010 = '" & a3 & _
"', A2011 = '" & a4 & _
"' where Id = " & IdRegistro & ""
Case AGREGAR_REGISTRO
cnn.Execute "INSERT INTO Personas " & "(Nombre,Apellido,Telefono,Direccion,Sexo,FechaDeAlta,A2008,A2009,A2010,A2011) VALUES('" & _
Text1(1) & "','" & _
Text1(2) & "','" & _
Text1(3) & "','" & _
Text1(4) & "','" & _
CmbSexo.ListIndex & "','" & _
Check1 & "','" & _
Check2 & "','" & _
Check3 & "','" & _
Check4 & "','" & _
Format(Date, "dd/mm/yyyy") & "')"
End Select
rs.Requery
Call CargarListView(FrmPrincipal.LV, rs)
DoEvents
Unload Me
-------------------------------------------------------------------------------------------------------------------------------
Muchas gracias por su ayuda :)
Valora esta pregunta


0