Page 1 of 1

Problem with SQlUpdate

Posted: Wed 13 Feb 2008 04:25
by MNosouhi
HI
I Change "CheckRowVersin" and "DMLRefresh" of MSQuery to "True" to have a Pessimistic lock (if 2 user try to edit one record , the first user could save changs,but second user recive error message "Update Failed : 0 record Found").
Pessimistic Lock work correctly while "SQlUpdate" do not has value. (if "SQLUpdate" has value , Pessimistic Lock do not work and second User do not recive error message).
is it a bug in sdac?

i use SDAC ver 4.35 and delphi7&Delphi2007 and windows xp with sql2005

Posted: Wed 13 Feb 2008 09:29
by Challenger
CheckRowVersion and DMLRefresh options affect autogenerated update SQL statements only. To perform optimistic record locking you should include all fields, to make sure they were not changed. If you want to use a rowversion field, you should remember that its value is changed after update, and you should refresh it in the dataset.