Re: Help on resolving record conflicts with ADO



An additional note on this issue:

I've been doing testing for several hours since my original post. It seems
that if I whittle down my original sql statement to just 1 table, the
conflict-resolution code I have in my PostError event works. So that leads
me to believe that there's a problem with uniqueness with my query. The odd
thing is that the query simply tacks on 1 field from another table - I'm
left outer joining the other table, and incidentally there can only be a
max. of 1 joined records per primary table. I'm using the key from the
primary table in the query.

I've also tried BetterADO, but it has not helped get passed my section of
code for re-syncing. I may not be using it properly, but I was reading
somewhere that setting the Primary Table property (something like that) in
the control (BetterADO) would eliminate any question about which table was
the primary table, so any updates on that table should work properly.

This may help - it seems that even though I'm specifically setting ['Update
Criteria'].Value := adCriteriaKey, when I do Action := daRetry I am faced
with the exact same PostError problem. It's as if the setting of the update
criteria didn't take.

"Bill Hicks" <waylien_no_spam@xxxxxxxxx> wrote in message
news:43fd6f59$1@xxxxxxxxxxxxxxxxxxxxxxxxx
I am using Delphi 7, SQL2000, ADO.

I am trying to find a clean way to resolve update conflicts between users
and am stuck. I have a SQL table that has a primary key. If a user
attempts to update a record that's already been updated by another user,
the OnPostError event fires and allows me to handle the conflict. So far
so good. Now, if I try to run the following code because the user has
choosen to overwrite the other users changes, I run into the same
OnPostError as soon as the retry occurs. It seems as though there is not
enough information to complete the update.

TAdoDataset(DataSet).UpdateCursorPos;
TAdoDataset(DataSet).Properties['Update Criteria'].Value :=
adCriteriaKey;
TAdoDataset(DataSet).RecordSet.Resync(adAffectCurrent,
adResyncUnderlyingValues);
Action := daRetry;

I thought that setting ['Update Criteria'].Value := adCriteriaKey was
going to allow me to use just the key field to make the update, but it
seems like ADO still cannot locate the record in question.

Thanks in advance.

Bill Hicks



.



Relevant Pages

  • Re: how do I get rid of "the expression you entered exceeds the 1,024-
    ... entered exceeds the 1,024-character limit for the query deisgn grid". ... FROM ((tblProjectActualIndicator AS Y INNER JOIN [SELECT ... Here is a link to the posting of how I received the original SQL ... I am an average Access user but the complexity of this query is beyond ...
    (microsoft.public.access.queries)
  • Re: Multiple calculations on same field in Query, by range of valu
    ... you might consider turning on the Name Auto Correct features and getting rid ... > My apologies, "Post the original SQL". ... Trying to write the following Query: ... > I create the following Calculated Field: ...
    (microsoft.public.access.queries)
  • Median from a Query
    ... sorts by original post date and not by activity date so this is a repost. ... module code posted in the Knowlege Base regarding median calculation. ... Perhaps the reason is that I am trying to get a median for values in a query? ... Anyway this results in having to store < in a separate field ...
    (microsoft.public.access.queries)
  • Re: Is Not Null
    ... according to your original post, above, you had code on a button "that runs ... running a query to opening reports, and just where/when it is that you want ... to check for null values in the controls you cited in your first post. ... MsgBox "Data Required In Each Field." ...
    (microsoft.public.access.forms)
  • Re: Mail Merge Module fails to open Data Source
    ... Just the start for you in DAO: ... qryContractData_Base is the same with your original SQL without the WHERE ... Before you start the MailMerge execution code, ... It is probably true that MailMerge can use the Table faster than the Query ...
    (microsoft.public.access.formscoding)