I searched the forum looking for a answer this question sorry if this was asked to many times. I'm trying to create a new record in the database and have it same, pretty simple I thought.
The program states that the problem is a INSERT INTO error but points toward insertCommand.ExecuteNonQuery() line. I'm not completely sure where I went wrong within that INSERT INTO line. I first thought it might be the variables User and Password in the Values line but changing it gets me nowhere.
The program states that the problem is a INSERT INTO error but points toward insertCommand.ExecuteNonQuery() line. I'm not completely sure where I went wrong within that INSERT INTO line. I first thought it might be the variables User and Password in the Values line but changing it gets me nowhere.
VB.NET:
Dim Connection As New OleDb.OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0; Data Source = C:\Password.accdb")
Dim insertCommand As New OleDb.OleDbCommand("INSERT INTO Password (User ID, Password) VALUES (User, Password)", Connection)
Try
Connection.Open()
insertCommand.ExecuteNonQuery()
Me.Validate()
Me.PasswordBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.PasswordDataSet)
Catch ex As Exception
MessageBox.Show(ex.ToString())
Finally
Connection.Close()
End Try