Board index » delphi » Problem with CachedUpdates
Ariel Mendelzon (TeamNetlan)
![]() Delphi Developer |
Sat, 08 May 2004 21:41:15 GMT
Problem with CachedUpdates
Hi everybody!!!
I have an application that uses TQuery components with cached updates. The thing here is that the environment is multiuser, so I need to handle possible record-overwriting problems. In this case, one terminal reads record X with A field's value equals to "1" and lets the user make changes to the record. Meanwhile, another terminal updates record X setting A field's value to "2". After this, the first terminal tries to update the record. An "update failed" exception is raised. My question here is: How can I (from the OnUpdateError handler), refresh the data in the current record so that the user can make changes to the data again and reapply?? I've tried closing and opening and repositioning the pointer in the record, but the closing and opening generates that after the handler's code is over, I get an "Access violation error". Is there another way to accomplish this? thanks -- |