lunes, 17 de febrero de 2014
ACTUALIZAR DATOS
Programa el botón de Actualizar
Private Sub CommandButton4_Click()
Dim cs As String
Dim sPath As String
Dim sql As String
Dim cn As ADODB.Connection
sPath = ThisWorkbook.Path & "\datos.accdb"
cs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & sPath & ";Persist Security Info=False;"
Set cn = New ADODB.Connection
cn.Open cs
sql = "UPDATE Estudiantes set " & _
"nombre='" & TextBox2.Text & _
"',apellido='" & Me.TextBox3.Text & _
"' where id='" & TextBox1.Text & "'"
cn.Execute sql
cn.Close
Set cn = Nothing
End Sub
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario