ADO .NET won't update table 
Author Message
 ADO .NET won't update table

As a demo, I've created a OleDbConnection, OledbDataAdapter, and a dataset
named dsEmployees that selects 3 fields from an Access database.  The data
is displayed in textboxes on a form.  I can load the dataset and navigate
through all of the records.  I have the following code in an Update button
event and it doesn't update the access database table:

Try
    OleDataAdapter1.Update(dsEmployees)
    msgbox "Table Updated"
Catch e as Exception
    Msgbox(e.ToString)
End try

The message nox displays the "Table Updated" message, but when I open Access
the change to the record is not made.



Wed, 29 Sep 2004 21:43:07 GMT  
 ADO .NET won't update table
Shouldn't you include the table name in the update as well?

Try
    OleDataAdapter1.Update(dsEmployees, "myTableName")
    msgbox "Table Updated"
Catch e as Exception
    Msgbox(e.ToString)
End try


Quote:
> As a demo, I've created a OleDbConnection, OledbDataAdapter, and a dataset
> named dsEmployees that selects 3 fields from an Access database.  The data
> is displayed in textboxes on a form.  I can load the dataset and navigate
> through all of the records.  I have the following code in an Update button
> event and it doesn't update the access database table:

> Try
>     OleDataAdapter1.Update(dsEmployees)
>     msgbox "Table Updated"
> Catch e as Exception
>     Msgbox(e.ToString)
> End try

> The message nox displays the "Table Updated" message, but when I open
Access
> the change to the record is not made.



Wed, 29 Sep 2004 21:50:54 GMT  
 ADO .NET won't update table
I tried both forms of the update method and both failed the same way.

Quote:
> Shouldn't you include the table name in the update as well?

> Try
>     OleDataAdapter1.Update(dsEmployees, "myTableName")
>     msgbox "Table Updated"
> Catch e as Exception
>     Msgbox(e.ToString)
> End try



> > As a demo, I've created a OleDbConnection, OledbDataAdapter, and a
dataset
> > named dsEmployees that selects 3 fields from an Access database.  The
data
> > is displayed in textboxes on a form.  I can load the dataset and
navigate
> > through all of the records.  I have the following code in an Update
button
> > event and it doesn't update the access database table:

> > Try
> >     OleDataAdapter1.Update(dsEmployees)
> >     msgbox "Table Updated"
> > Catch e as Exception
> >     Msgbox(e.ToString)
> > End try

> > The message nox displays the "Table Updated" message, but when I open
> Access
> > the change to the record is not made.



Thu, 30 Sep 2004 02:33:46 GMT  
 ADO .NET won't update table
Bob,

Search your code for "AcceptChanges" and remove it unless you understand
specifically why you are using it (it is uncommon to use it).

If you don't find it, then look at hte rowstate, because it is incorrect on
your altered rows.

It is also possible that you need an EndCurrentEdit if you are only losing
data from the last row edited.

Kathleen



Thu, 30 Sep 2004 10:55:12 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VB.NET app won't work after update to WinXP SP1

2. Acc2000: Access tables attached to SQL-Server won't update

3. TITLE field won't update in header table

4. ADO Won't update records??

5. ADO won't let me update a local recordset

6. ADO Recordset won't Update

7. ADO.NET Update Source Table Problem

8. ADO.NET Update Source Tables Problem

9. Visual Basic .NET and ADO.NET code - Disconnected Updating Help

10. CR reports in VB4 won't update (I've tried the usual solutions)

11. what create table using ADO.NET to VB.NET

12. VB6,Access97,ADO - Update query doesn't update all records

 

 
Powered by phpBB® Forum Software