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!

Database CONCURRENCYVIOLATION

Status
Not open for further replies.

faccorp

Programmer
Jan 24, 2002
58
US
In my client app, I have a form that Opens a connection to an SQL Server table (i'm using OLE DB).

The form allows the user to MovePrev/MoveNext through records that have been entered in the table. If the user Moves to a record, then changes some of the data, when the client app issues the SetData command, everything works fine. However, if they come back to that record and try to update again, the error DB_E_CONCURRENCYVIOLATION occurs. This error has to do with record locking and I know I am using optimistic concurrency.

The only way I found to keep this from happening was to Close that table (after the record is updated) and then reopen the table, then go and move to the record that was just updated. These seems very ineffecient.

Any ideas on the safest yet most efficient method of handling this? There will be multiple users acessing the data.

 
Do you ever want more than one user? If so I wouldn't try to do it like this.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Yes there will be multiple users.

Then what would you recommend?

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top