VS.NET 2003, ADO.NET 1.1 and Access 2000: Getting a Concurrency violation

R

Rod

I have written a Visual Studio .NET 2003 app, using ADO.NET to retrieve
several hundred records out of an Access 2000 database, and putting them all
into a DataSet. Then my app goes against a SQL Server 2000 database,
retrieves other data and updates about 500 records in the DataSet. I am
only interested in updating about 50 of the columns in each row (there are
about 150 columns in the table), I decided to write my own update command
and associate it with the OleDbDataAdapter that I use to retrieve the
original table from the Access database. And I also thought I would
determine how many records there are to update, before I retrieve anything
from SQL Server.



When I run my app, it gives me an error that says, "Concurrency violation:
the UpdateCommand affected 0 records."



However, I have also discovered that this error message isn't exactly true.
It has, in fact, updated 1 record. It does that each time I run the app, as
the total count of records needing updating is 1 less each time I run this.
So, my guess is that it is updating the first record and then something
stops it from updating anything more.



I have experimented, to a small degree, with isolation level, but Access
doesn't support much, along those lines.



So, what am I doing wrong, and what could I do to make it possible for the
app to submit all 500 records, rather than having me run my application 500
times?

Rod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top