top of page
Writer's pictureKarl Donaubauer

RefreshLink fails with "Primary Key already exists" (Fixed)

Updated: Mar 13


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.

1,057 views7 comments

Recent Posts

See All

7 comentários


Kent Gorrell
29 de abr.

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

Curtir
Andre Goldmann
Andre Goldmann
10 de mai.
Respondendo a

Yes, I just noticed there is a change.

CREATE UNIQUE INDEX PrimaryKey ON... now fails with error 3283, because the index is indeed already there.

Access has always asked for the PK when linking a view, and still does. It also created an index. But apparently up til 2401 this index was lost when doing TD.RefreshLink for a linked view. With 2402 this index prevails as "__uniqueindex".

Curtir

Andre Goldmann
Andre Goldmann
13 de mar.

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.

Editado
Curtir
Karl Donaubauer
Karl Donaubauer
13 de mar.
Respondendo a

Thanks, Andre, for the first confirmation that the update to 2401 in MEC helps! Now, I can add our usual (Fixed) to the article title. 😎

Curtir

Andre Goldmann
Andre Goldmann
05 de mar.

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!

Curtir

Dale Fye
Dale Fye
28 de fev.

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

Curtir
Colin Riddington
Colin Riddington
28 de fev.
Respondendo a

Hi Dale. The issue only applies to users in the Monthly Enterprise Channel version 2312 who are refreshing links in code. It isn't relevant to A2010 nor when links are refreshed using the linked table manager.

Curtir
bottom of page