Código
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try connetionString = "PROVIDER=Microsoft.ACE.OLEDB.12.0;Data Source=C:\concurrencia\base.accdb;" connection = New OleDbConnection(connetionString) connection.Open() adapter = New OleDbDataAdapter("SELECT * from tabla2", connection) adapter.Fill(DataSet, "tabla2") tabla = New DataTable() adapter.Fill(tabla) Catch ex As Exception MsgBox(ex.ToString) End Try End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim comando As OleDbCommand = connection.CreateCommand() adapter.UpdateCommand = New OleDbCommand("UPDATE tabla2 set nombre=@nombre, apellido=@apellido WHERE nombre=@oldnombre AND apellido=@oldapellido", connection) adapter.UpdateCommand.Parameters.Add("@nombre", OleDbType.VarChar, 255).Value = txtID.Text adapter.UpdateCommand.Parameters.Add("@apellido", OleDbType.VarChar, 255).Value = txtCharData.Text parameter = adapter.UpdateCommand.Parameters.Add("@oldnombre", OleDbType.VarChar, 255, "nombre") parameter.SourceVersion = DataRowVersion.Original parameter = adapter.UpdateCommand.Parameters.Add("@oldapellido", OleDbType.VarChar, 255, "apellido") parameter.SourceVersion = DataRowVersion.Original adapter.UpdateCommand.ExecuteNonQuery() adapter.Update(dataset, "tabla2") adapter.Fill(dataset, "tabla2") connection.Close() Catch ex As Exception MsgBox(ex.ToString) End Try End Sub
[MOD]: Utiliza el botón de "Insertar código", gracias.