I have searched the web and forums for similar problems and tried the solutions they received. I am a noob at databases so any help would be appreciated.
Right now my app connects to my access database,but I am trying to add a new record to it.
There are two columns (Account & Username) and on the form two textboxes. I simply need the Account Text box to go into column 1 and Username into Column 2 on the same row.
Below is what I have right now but I get an error on the last line saying that it can't find the table
Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As New OleDb.OleDbConnection con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Users\Beaver\Documents\Accounts.mdb" If con.State = ConnectionState.Open Then con.Close() End If Dim UpdCmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("UPDATE Tabel1 Set Account = ?, Username = ?", con) Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter da.UpdateCommand = UpdCmd Dim ds As DataSet = New DataSet("Tabel1") UpdCmd.Parameters.AddWithValue("@Account", Me.SiteText.Text) UpdCmd.Parameters.AddWithValue("@Username", Me.UserText.Text) con.Open() Dim ret As Integer = UpdCmd.ExecuteNonQuery() End Sub


Reply With Quote

