
13/09/2006, 10:29
|
| | Fecha de Ingreso: septiembre-2005
Mensajes: 74
Antigüedad: 19 años, 7 meses Puntos: 0 | |
Gracias tazzito, este es mi codigo
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click() BOTON AGREGAR
rs.AddNew
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Command2_Click() BOTON GRABAR
rs.Fields("Nombre") = Text1.Text
rs.Fields("Apellido") = Text2.Text
rs.Update
Text1.Text = ""
Text2.Text = ""
MsgBox "Tus registros han sido guardados"
End Sub
Private Sub Form_Load()
conn.Open "driver={mysql odbc 3.51 driver};" _
& " user= Administrador;" _
& " password= 123;" _
& " server= localhost;" _
& " database= Contratos;" _
rs.Open "select * from Generales", conn, adOpenStatic, adLockOptimistic
Text1.Text = rs.Fields("Nombre")
Text2.Text = rs.Fields("Apellido")
End Sub
Private Sub siguiente_Click() BOTON SIGUIENTE REGISTRO
rs.MoveNext
End Sub |