Solved

Can't update MS SQL2005 table from MS Access form

Posted on 2012-03-12
5
256 Views
Last Modified: 2012-03-12
I'm trying to update a field in an MS SQL 2005 table from a form in MS Access.  I keep getting a Write Conflict but I'm the only one using the db.  I get the same error even if I try to update a record in the table without going through the form. I'm the db admin for the database.  I can append with no problem.  The table has a primary key.  Any ideas?
0
Comment
Question by:WhamMcC
  • 2
  • 2
5 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 37711238
If you have bit  fields in your table try setting allow nulls to false
0
 

Author Comment

by:WhamMcC
ID: 37711368
You may be onto something but when I attempt to change the data type not allow nulls, I get the following error message:


'Rebates' table
- Unable to modify table.  
Cannot insert the value NULL into column 'Prep01', table 'dbSalesInfo.dbo.Tmp_Rebates'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Is this because I have nulls  and if so how can I get rid of them?
0
 

Expert Comment

by:gnetgnet
ID: 37711909
Can you initialize the values to spaces if char or 0 if numeric?
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 37711981
Set the default value of the field to False and if you have any existing NULLS in your bit column, make a backup and run an update query to set them to false:

UPDATE YourTable
SET YourField = False
WHERE YourField IS NULL


(Allowing nulls in bit fields is one consistent cause of that WriteConflict error that I have seen in upsized Access databases.)
0
 

Author Closing Comment

by:WhamMcC
ID: 37712002
Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now