[AccessD] Write Conflict Error

Jim Lawrence accessd at shaw.ca
Wed May 12 11:28:43 CDT 2010


Hi Rocky:

When you isolate the data with out going through the application do you
still have the same errors? 

Two thoughts, one; is the error caused because changing the date causes a
unique key conflict error?... or two; could it be caused by invalid data or
date field setting that cause the system to easily become confused as to
whether a validate date is really being added to a specific field?

Jim

 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Wednesday, May 12, 2010 7:38 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Write Conflict Error

Lambert:

The real source of the problem is that the database is not completely
normalized.  (now this is a legacy app so I can't full credit for this
problem - the app involves tracking legal matters for patents and
trademarks.).  

Each legal Matter can have many Actions.  Each Action has a Due Date.  Each
Action also can have several Matter Action Dates for different activities
for that Action (at least one - which is the default) - the date being the
End Date for that activity.

The client first asked me to add a radio button to the Matter Action Dates
for a given Action, indicating which action date was the "Default".  The
Default Matter Action Date then became the Due Date for the Matter Action.
So then it then became necessary, when the user changed the Default Date In
the Matter Action Dates to update the Due Date in the Matter Action.

And the reverse is true as well.  When the Due Date in the Matter Action
gets changed, it then became necessary to update the End Date of the Default
Matter Action Date record with the new Due Date.

That's when the trouble started. Both updates SOMETIMES (not consistent,
that would be too easy) give the Write Conflict.

I solved the problem of changing the default date in Matter Action Dates by
using db.Execute and an update query to change the Matter Action Dues Date.
And that seems to be working now.  Maybe.  Testing this thing is a bitch.

I'm still getting the problem of a write conflict SOMETIMES when changing
the Due Date of the Matter Action and I think that's because I'm changing
the Matter Action Dates record, but I'm not sure.

Anyway, I don't think without tearing this beast apart, you can tell me
offhand what's going on, but writing all this out is at least making it
clearer to me.  So thanks for your patience. 

Best,

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert
Sent: Wednesday, May 12, 2010 6:17 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Write Conflict Error

Hmm. Form and sub-form using the same table...

Well as you are getting the conflict error when the parent form tries to
save the sub-form's data that implies that the parent has edited the data
too.

So is there any convenient point in the process where you can call
Me.Dirty=False on the parent form prior to allowing the sub-form to edit
data?

Lambert 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Tuesday, May 11, 2010 7:32 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Write Conflict Error

Lambert:

I had already tried Dirty = False but the problem occurs in the line:

Forms!Matters!MatterActionsSubform.Form.Dirty = False

Which is being issued from a different form named MatterActionDates 

The record sources for MatterActionsSubform and the calling form,
MatterActionDates, share a table.  The calling form's record source uses
MatterActionDates: 

SELECT MatterActionDates.* FROM MatterActionDates ORDER BY CInt(Nz([Y])),
CInt(Nz([M])), CInt(Nz([D]));

The record ssource for MatterActionsSubform is:

SELECT MatterActionDates.MatterActionDatesDefaultOffset,
MatterActionDates.Y, MatterActionDates.M, MatterActionDates.D, * FROM
qryMatterActions LEFT JOIN MatterActionDates ON
qryMatterActions.MatterActionID = MatterActionDates.MatterActionID WHERE
(((MatterActionDates.MatterActionDatesDefaultOffset)=True) AND
((qryMatterActions.MatterID)=7756) AND ((qryMatterActions.Closed)=False))
ORDER BY qryMatterActions.DueDate;

So they're sharing the table MatterActionDates.   (qryMatterActions uses
only the table MatterActions)

Any clues here?

TIA

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert
Sent: Tuesday, May 11, 2010 9:59 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Write Conflict Error

Is it a bound form? Are you also editing the data in the code behind the
form? If so you need to save the bound form record before making any edits
in code.

TO save the record:  Me.Dirty=False

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Tuesday, May 11, 2010 12:43 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Write Conflict Error

Dear List:

I'm getting a write conflict error in a form but it's not consistent.  So
I'm not sure where to begin.  I'm running the FE and BE locally - just me in
the system.  Any clues on where to start looking appreciated.

MTIA

Rocky

 


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list