Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OdbcDataAdapter, Update method and maximum edited columns

Status
Not open for further replies.

mansii

Programmer
Oct 18, 2002
641
ID
- VS 2005, Visual Basic
- MS Access mdb

Hi all!
DataAdapter is one of my favourite objects since there's no need to open any connection to the database (yes, no .ldb file created).
And I can get the advantage of using the CommandBuilder.
But sometimes it gives me a headache when this error occurs:
... too many fields...

Yes, it doesn't always happen.
I have tried setting the CommandBuilder's SetAllValues to False so that the edited data would only check the primary keys.

Scenario:
In one of my mdb table I have about 150 fields, four of them are primary key.
Using the DataAdapter, I filled out a DataTable, then get one Datarow from it containing the searched primary keys.
If the DataTable contains the desired primary keys then I use this datarow for editing. If not, create one DataTable.NewRow, fill the PK with unique values and modify the rest of fields.
The above error occurs when the DataAdapter.Update(Datatable) is executed. Again, not always but it happens.

Question:
Is the DataAdapter bound to any maximum modified fields? If so, how many? If not, is there any properties of either the DataAdapter, DataTable, OdbcCommand, or even the Connection that I have to change?

Thank's in advance.
 
Oops, sorry, did I mention that I had set the
CommandBuilder.ConflictOption to ConflictOption.OverwriteChanges? Because I did it too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top