By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,711 Members | 2,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,711 IT Pros & Developers. It's quick & easy.

Write Conflict Access97 to SQL 2000 bound form

P: 2
Hi guys
I've read the posts on Write conflict entered in this forum (along with some from kbAlertz and microsoft) and i have tried all the solutions without success. let me give you some background.

i have an access form bound to a customers table in sql. the table in sql has an index on the customer code and has an autoincrement field generated by sql (rowid). i have also put a time stamp field.
My Access form does not add any records to sql it only allows the user to edit certain fields. I however have buttons on this form that allow the user to set as default what they have entered for one customer, for all. ie if delivery time for customer is 18:00:00 then i have a button that has the following code
-----initialization etc
db.Execute "Update CustomerSetup set HourToCountFrom= '18:00:00'"
now, the first time the user clicks the button the update happens without any error message. However any subsequent attempt to update results in the famous --write conflict etc----

I have 2 questions
1)is there any thing else i can try (i ve tried the timestamp trick,set to 0 all int and tinyint fields that dont have a value,set defaults to zero on int and tiny ints, removed all nulls in any var and nvarchar fields,removed any floating point fields)
2) could the problem be that i am using a bound form and at the same time executing code against the table the form is bound on, and hence causing a problem when execution completes on sql server and the bound form doesnt know it yet? and if so, why doesnt the me.requery method simply pick up the changes on the database?

Sorry for the long post but this thing has me pulling out my hair.

Mar 31 '06 #1
Share this Question
Share on Google+
1 Reply

P: 2
Hi. feels a little odd replying to my own post, but i think i've found the problem. This is my Theory.
When the user enters data into a field and clicks on the update button that uses db.execute to update the db directly, it changes the record in the db. however after this update there is a Me.refresh command that tells the form to update itself. it then finds that the records is different from the one in the buffer and throws up the write conflict error. The solution therefore is to save the record FIRST via the bound form (by clicking in code, the save button) and then doing the database update via db.execute. i did this and the problem is solved.
Thanks for all those who took the time to try and figure this one out.
Mar 31 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.