Problema con insertar
Publicado por macr (3 intervenciones) el 08/08/2007 22:30:34
Quiero insertar un Dato pero tengo problema en rs.EOF me dice El numero de argumentos es incorrecto o la asignacion de propiedades no es validad, que puede deber ese error?
Private Sub Comando22_Click()
Set rs = New ADODB.Recordset
Set cn = Application.CurrentProject.Connection
rs.Open "INSERT INTO alumnos([rut_alum], [nom_alum], [ape_alum], [dir_alum], [telefono], [fecha_nac], [rut_apo])VALUES ('" & Val(Me.Texto6) & "', " & Val(Me.Texto8) & " , " & Val(Me.Texto10) & ", " & Val(Me.Texto12) & " , " & Val(Me.Texto14) & " , " & Val(Me.Texto16) & ", " & Val(Me.Texto18) & " )", cn, adOpenDynamic, adLockPessimistic
Dim mens As Integer
mens = MsgBox("Confirma el ingreso?", vbQuestion + vbYesNo + vbDefaultButton2, "ingresar Alumno")
If mens = vbYes Then
rs.EOF
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End If
End Sub
Private Sub Comando22_Click()
Set rs = New ADODB.Recordset
Set cn = Application.CurrentProject.Connection
rs.Open "INSERT INTO alumnos([rut_alum], [nom_alum], [ape_alum], [dir_alum], [telefono], [fecha_nac], [rut_apo])VALUES ('" & Val(Me.Texto6) & "', " & Val(Me.Texto8) & " , " & Val(Me.Texto10) & ", " & Val(Me.Texto12) & " , " & Val(Me.Texto14) & " , " & Val(Me.Texto16) & ", " & Val(Me.Texto18) & " )", cn, adOpenDynamic, adLockPessimistic
Dim mens As Integer
mens = MsgBox("Confirma el ingreso?", vbQuestion + vbYesNo + vbDefaultButton2, "ingresar Alumno")
If mens = vbYes Then
rs.EOF
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End If
End Sub
Valora esta pregunta


0