Solved

Can't update MS SQL2005 table from MS Access form

Posted on 2012-03-12
5
255 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

23 Experts available now in Live!

Get 1:1 Help Now