estoy haciendo un sistema, mi problema es que no puedo dar de alta, bueno es que estoy haciendo la coneccion directa y no me sale




Cita:
plisDim cn As New ADODB.Connection 'Creamos el objeto Connection.
Private WithEvents rs As ADODB.Recordset 'Creamos el Recordset con soporte de eventos.
Private Sub agr_reg_Click()
Respuesta = MsgBox("Deseas dar de alta un nuevo registro?", vbYesNo, "REGISTRO DE ALTA")
If Respuesta = vbNo Then
Exit Sub
Else
Guardar.Enabled = True
Text1.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
With rs
.AddNew
.Fields("clave") = Val(Text1.Text)
.Fields("fecha") = Date
.Fields("formato") = Trim(Text3.Text)
.Fields("descripcion") = Trim(Text4.Text)
.Fields("lugar") = Trim(Text5.Text)
End With
End If
Private Sub Guardar_Click()
rs.Update
End Sub
End Sub
Private WithEvents rs As ADODB.Recordset 'Creamos el Recordset con soporte de eventos.
Private Sub agr_reg_Click()
Respuesta = MsgBox("Deseas dar de alta un nuevo registro?", vbYesNo, "REGISTRO DE ALTA")
If Respuesta = vbNo Then
Exit Sub
Else
Guardar.Enabled = True
Text1.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
With rs
.AddNew
.Fields("clave") = Val(Text1.Text)
.Fields("fecha") = Date
.Fields("formato") = Trim(Text3.Text)
.Fields("descripcion") = Trim(Text4.Text)
.Fields("lugar") = Trim(Text5.Text)
End With
End If
Private Sub Guardar_Click()
rs.Update
End Sub
End Sub
