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.
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.