C
Curt Emich
I'm trying to insert a new record into an MS Access table. The code below
compiles and runs, but it doesn't write a record into the table. Can
someone tell me why?
Dim thisSelectCommand As New OleDb.OleDbCommand("SELECT * FROM Sessions",
Me.OleDbConnection1)
Dim thisDataAdapter As New OleDb.OleDbDataAdapter(thisSelectCommand)
Dim thisDataset As New System.Data.DataSet()
thisDataAdapter.Fill(thisDataset, "Sessions")
thisDataAdapter.InsertCommand = New OleDb.OleDbCommand("INSERT INTO Sessions
(Notes) VALUES('Yadda')")
thisDataAdapter.Update(thisDataset, "Sessions")
thisDataset.AcceptChanges()
compiles and runs, but it doesn't write a record into the table. Can
someone tell me why?
Dim thisSelectCommand As New OleDb.OleDbCommand("SELECT * FROM Sessions",
Me.OleDbConnection1)
Dim thisDataAdapter As New OleDb.OleDbDataAdapter(thisSelectCommand)
Dim thisDataset As New System.Data.DataSet()
thisDataAdapter.Fill(thisDataset, "Sessions")
thisDataAdapter.InsertCommand = New OleDb.OleDbCommand("INSERT INTO Sessions
(Notes) VALUES('Yadda')")
thisDataAdapter.Update(thisDataset, "Sessions")
thisDataset.AcceptChanges()