I'm trying to figure out some basics with VB.net and interfacing with a MSAccess .accdb.
For the sake of this test, the .accdb file is located in the root directory of the project.
I've already created a basic "Select" statement, and can pull data from my table within the .accdb. That works fine.
It's the updates and inserts that I can't get to work. The code below seems straightforward, and I've had this exact code work when connecting to an SQL server (with a change to connection string of course), so it's something about this access database.
The database itself is brand new, just created it, and then added a single table with a small sample of data. There is no security setup on it that I know of. I also set Windows File permissions to Everyone -> Full Access to rule out permissions there.
The code does not generate any errors, it simply doesn't cause a change to the DB.
Does anyone have any thoughts?
Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=filename.accdb;Persist Security Info=False;"
Dim ds As New Data.DataSet()
Dim da As New Data.OleDb.OleDbDataAdapter()
Dim conn As New Data.OleDb.OleDbConnection(connString)
Dim cmd As New Data.OleDb.OleDbCommand("UPDATE TableName SET Manufacturer = 'abc123' WHERE MsdsID = 9")
cmd.Connection = conn
txtTemp.Text = cmd.ExecuteNonQuery()