Primary Key, autoincrement field set to zero

K

kloppie

Hi there,

I'm working on a app which is suppossed to update an Access 2000
database through an Web Service.

So i have made an Windows App. which works on a disconnected DataSet.
It then Insert and Update this DataSet and sends it to the Web Service,
which then inserts it into the actual Access database.
The Web Service then returns a DataSet with the changes made in the
database. The two DataSet's are then merged.

My problem is that after adding a new Row to the disconnected DataSet,
i can see that it's primary autoincrement key is set to zero. When i
then try to merge it with the DataSet from the Web Service, the Row is
added again instead of acknowledged as the same Row.

Anybody experienced the same problem?
Any help will be appreciated,

- Martin Klopp Jensen
 
C

Colin R. R. Johnson

Hi Kloppie,

It sounds to me like you need to send the primary key back from the web
server to the client so it knows what the primary key is.

You may also want to set the autoIncrementSeed to -1 and the increment
to -1 for the key field, particularly if you are adding multiple records.

If there are related tables for which this one is the primary table,
ensure that you set the relationships to cascade the change to the
primary key to the child tables.

Colin R. R. Johnson.
 

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