Acess Database Update Button **NOT RESOLVED**
I read the tutorial why is this code not updating my access data?
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
OleDbDataAdapter1.Update(DsCompanyInfo1)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
The database is showing my data but will not save the new data.
Can anyone help?
Thanks,
Aaron
didn't mean to kill you.... :)
just seems that it should work, can't see what you are doing wrong, if you are doing something wrong at all.
I added the employees table of the Northwind database and created a typed dataset. Then I added the following code to the form, wich have a datagrid:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.Fill(Ds11)
DataGrid1.DataSource = Ds11
DataGrid1.DataMember = "Employees"
End Sub
The I remove one row, add another and change a third and hit the button that has the following code:'
Code:
Private Sub Button4_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button4.Click
SqlDataAdapter1.Update(Ds11)
End Sub
Tested this with the oledb thing against a Access database as well, and mine updates in both cases.
Everything appears to be the same...
Ok,
Could it possibly be the MS Access DB I am using?
I am using Office XP... Do I need to Export it to another type or earlier version??
All my code appears to be exactly the way the above example is written...
Thanks,
Anjari