Description
When using the RefreshLink method for a linked SQL Server table in version 2312 build 17126.20190, you get error 3283 "Primary Key already exists". The affected build was rolled out to the Monthly Enterprise Channel (MEC) starting on February 13, 2024.
There are a few forum discussions about this problem, e.g. on Microsoft Answers.
Cause
Regression.
Status
The problem is fixed with the MEC update to version 2401 build 17231.20290 released on March 12. If you don't receive it automatically, you should be able to get it by choosing "Update Now".
Until you get the fix, there are some workarounds:
Workaround 1
Use error handling to suppress error 3283. This will allow the links to refresh successfully with no messages.
Workaround 2
Use the Linked Table Manager to refresh the links.
Workaround 3
If you are in the Monthly Enterprise Channel then try not to install version 2312 build 17126.20190 or roll back to an older build like 17029.20178 if you have already done so.
Workaround 4
You could (possibly only temporarily) change the update channel. Either to the slower Semi Annual, where the problem does not yet exist, or to the Current Channel, where the problem has already been fixed.
Note: This bug affected Current Channel version 2312 in January and was fixed for this channel without a new build (see Colin Riddington's detailed article). However, the problem remained active in the Monthly Channel.
Linking a new view with DoCmd.TransferDatabase, Access now prompts for the Primary Key column and automatically creates a PK for the view with the name "__uniqueindex" that's with two underscores. I'm using 2311.
You no longer need to use CREATE UNIQUE INDEX PrimaryKey ON... to create the PK.
if you later need to view the PK colum name use this...
PKColumn_Name = CurrentDB.TableDefs([View Name]).Indexes(0).Fields(0).Name
After manually updating to 2401 in Monthly Channel, the error is gone. 🙂
The same error 3283 "Primary Key already exists" happened in 2312 when running
db.Execute "CREATE INDEX PrimaryKey ON MyViewName (MyPrimaryKeyField) WITH PRIMARY"
after (re-)linking a SQL Server view in VBA, to make it editable.
This error is also gone.
Awesome. 😣 We just switched from Current Channel to Monthly Channel, in order to avoid getting all the fresh regression bugs with Office updates. But thank you Karl for the article!
Karl,
Thanks for the post. I've got a client that had this issue late last week when I attempted to refresh the links on one of their applications. I didn't even consider checking whether the refreshlinks had worked. They are still running on A2010, despite my upgrade recommendations, so they don't have the new relinker so I use my Linked Table Manager. Instead, I modified my linker to drop the linked table and relink it, which worked fine. I'll go back and take another look and if the refreshlinks is actually working, will modify that code to ignore the "warning" and move on.
Dale