简体   繁体   中英

Concurrency error with MS-Access Linked Tables

I am linking tables to a SQL 2008R2 DB via MS Access Linked Tables.

I am getting this warning when I want to change the data in an Access linked table where the underlying SQL table has more than one bit field in it:

The record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes the other user made

I don't have any problems when there is only one bit field in the table. It's really a strange error imho. Has any one else encountered this before and found a work around for it by any chance?

I've seen this sort of issue in working with linked tables in general with SQL. I'm not sure why you're seeing the issue specifically with bit fields. Try adding a 'ts' column with the datatype of timestamp (rowversion) to the table and relink it in Access.

I know this is an old question, but maybe my answer will benefit others since I struggled with same and other similar issues.

I had similar error and was mostly able to get around it. One thing that may help is to use SQL Profiler on the database and watch the SQL commands made by Access while you are trying to add a new row.

Few things to check.. 1) Verify that you have an ID column in the table set as the Primary key and AutoNumber 2) If this involves a master/child relationship between another table, in the Access Database Tools "Relationships", specify the relationship and the join type between these types. 3) If a join between tables, then play around with the primary column and foreign column being exposed in the query.

Using the SQL Profiler, I would see where it would try to find the row to update based on other columns besides the primary key. eg

update table set ... where id = 5 and data1 = somevalue and data2 == othervalue

When doing this, I would sometimes get the same error since I may have edited other values in the new row and therefore the complex where clause would fail. What you want is to have the update rely totally on the primary key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM