I'm fairly new to VB.Net 2005 development and I am in need of updating MS
Access 2000 data via code. This was easy to do in my prior programming
language, but I am stuck here. :(

I am using the following test code that when a button is pushed, the
contents of the Customer_ID field is changed. Well, it does change. I have
a datagrid on Windows Form connected to an Access database and the chage
occurs, but is not saved. When I exit the program and re-run it, the old
data remains.

Thanks for any assistance.

Private Sub btn_GetCustomerInfo_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btn_GetCustomerInfo.Click

Dim MyData As DataRow

Dim MyString As String

MyData = ds_Binding.Tables(0).Rows(CARES_BindingSource.Position)

MyString = MyData("Customer_ID")

MessageBox.Show(MyString)

'Change It's Value

MyData("Customer_ID") = "123456789"

MyData.AcceptChanges()

End Sub

Re: Problems Updating Access Table by RobinS

RobinS
Sun Mar 18 18:45:56 CDT 2007

I think I saw this posted somewhere else, but I'm not sure, so I'm going to
give you a quick answer.

Calling AcceptChanges removes the "marks" behind the scenes in the dataset
that tells it which records have been modified.

To do an update, you need to call the Update method on the Data Adapter or
Table Adapter you used to fill the dataset or DataTable. It will update any
rows that are marked as new, deleted, or changed.

Robin S.
-----------------------------
"Octavius Khan" <nomail@please.com> wrote in message
news:McKdnVvrGOChXGDYnZ2dnUVZ_viunZ2d@comcast.com...
> I'm fairly new to VB.Net 2005 development and I am in need of updating MS
> Access 2000 data via code. This was easy to do in my prior programming
> language, but I am stuck here. :(
>
> I am using the following test code that when a button is pushed, the
> contents of the Customer_ID field is changed. Well, it does change. I
> have a datagrid on Windows Form connected to an Access database and the
> chage occurs, but is not saved. When I exit the program and re-run it,
> the old data remains.
>
> Thanks for any assistance.
>
> Private Sub btn_GetCustomerInfo_Click(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles btn_GetCustomerInfo.Click
>
> Dim MyData As DataRow
>
> Dim MyString As String
>
> MyData = ds_Binding.Tables(0).Rows(CARES_BindingSource.Position)
>
> MyString = MyData("Customer_ID")
>
> MessageBox.Show(MyString)
>
> 'Change It's Value
>
> MyData("Customer_ID") = "123456789"
>
> MyData.AcceptChanges()
>
> End Sub
>
>



Re: Problems Updating Access Table by Octavius

Octavius
Mon Mar 19 00:38:32 CDT 2007

Thanks, Robin.

"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:f5ydnZZTPYeoUmDYnZ2dnUVZ_oernZ2d@comcast.com...
>I think I saw this posted somewhere else, but I'm not sure, so I'm going to
>give you a quick answer.
>
> Calling AcceptChanges removes the "marks" behind the scenes in the dataset
> that tells it which records have been modified.
>
> To do an update, you need to call the Update method on the Data Adapter or
> Table Adapter you used to fill the dataset or DataTable. It will update
> any rows that are marked as new, deleted, or changed.
>
> Robin S.
> -----------------------------
> "Octavius Khan" <nomail@please.com> wrote in message
> news:McKdnVvrGOChXGDYnZ2dnUVZ_viunZ2d@comcast.com...
>> I'm fairly new to VB.Net 2005 development and I am in need of updating MS
>> Access 2000 data via code. This was easy to do in my prior programming
>> language, but I am stuck here. :(
>>
>> I am using the following test code that when a button is pushed, the
>> contents of the Customer_ID field is changed. Well, it does change. I
>> have a datagrid on Windows Form connected to an Access database and the
>> chage occurs, but is not saved. When I exit the program and re-run it,
>> the old data remains.
>>
>> Thanks for any assistance.
>>
>> Private Sub btn_GetCustomerInfo_Click(ByVal sender As System.Object,
>> ByVal e As System.EventArgs) Handles btn_GetCustomerInfo.Click
>>
>> Dim MyData As DataRow
>>
>> Dim MyString As String
>>
>> MyData = ds_Binding.Tables(0).Rows(CARES_BindingSource.Position)
>>
>> MyString = MyData("Customer_ID")
>>
>> MessageBox.Show(MyString)
>>
>> 'Change It's Value
>>
>> MyData("Customer_ID") = "123456789"
>>
>> MyData.AcceptChanges()
>>
>> End Sub
>>
>>
>
>