Data Access Worldwide Knowledge Base

Article ID 2277
Article Title ERROR: "Field cannot be updated." when saving to an Access table using ODBC
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2277
KBase Category CONNECTIVITY KITS
Date Created 12/08/2006
Last Edit Date 12/08/2006


Article Text
PROBLEM:
I use the ODBC Connectivity Kit 4 and Microsoft Access. When I try to save an edit to a record, I get the following error:
---------------------------
Error
---------------------------
Deadlock or Time out. 23000 (-1048)--[Microsoft][ODBC Microsoft Access Driver] Field cannot be updated. [Customers]

Technical Details
Error Number: 12303
Line Number: 35763
---------------------------
OK  
---------------------------

How can I correct that?

SOLUTION:
Microsoft Access need to have the DUMMY_UPDATE_COLUMN keyword set so that a record can be locked and your changes saved to it. You are probably using autonumber for your record identity column, and that's why the error is displayed.

To fix that, just set the DUMMY_UPDATE_COLUMN keyword to any other (updatable) column in the database.

Also, make sure you have an Access.int in you Bin directory and that the following line is part of that file:
Use_Identity_Type 1



More on DUMMY_UPDATE_COLUMN keyword:
If the backend database does not support exclusive locks on records, a dummy update will be done directly after a record has been found while in a transaction.

The dummy update mechanism updates a record (without changing any field value) directly after it has been found. The record identity column is set to the value just returned by the find. This happens in the find logic.

If the record identity column is not "updatable" (it could be an auto-increment, for example), you can set up an alternative column by using the intermediate file keyword DUMMY_UPDATE_COLUMN. The Dummy_Update_Column keyword should be set to the number of the column you want to "dummy update". Column numbers start at 1.




IMPORTANT!
Do not use Database Builder to change the structure of your table. Autonumber type of field is NOT saved back as Autonumber but Number




Contributed By:
Marcia Booth
Company: Data Access Worldwide
Web Site: http://www.dataaccess.com

Web Links Related to this Article
DAW Knowledge Base article 1224: HOWTO: Converting numeric fields from DataFlex to Access
URL=http://www.dataaccess.com/KBPrint.asp?ArticleID=1224


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.