Description
When you (re)link SQL Server tables using code, the naming of the linked tables no longer matches the previous behaviour.
The first parameter of the CreateTableDef method, [Name] for the local table name, is ignored. Instead the resulting table in Access is named after the third parameter SourceTableName, whereby the schema name (in most cases "dbo") is omitted. However, some people have reported that the omission of the schema prefix does not always happen. The logic behind this inconsistency of the bug is still unclear.
Depending on the specific circumstances, the changed behaviour can cause consequential errors like 3215 "dbo.TableName is not a valid name".
Cause
The first report was made on 2023-01-09 for Access 365 version 2212 build 15928.20198 in this Answers discussion. Many other users have confirmed the problem for version 2212. The recently updated click2run versions of Access 2016/2019/2021 are also affected, because they are all version 2212.
Status
Version 2301 (Build 16026.20146) released in the Current Channel on 26th January, has a fix for this bug. Several affected people have confirmed that the problem is resolved in this version.
Microsoft has as well published an article about the problem.
Until you get the fix, you can try to use one of these temporary remedies:
Workaround 1: Reverting to Office/Access version 2211 helps.
Workaround 2: (Re)linking works again in many cases when the schema prefix "dbo." is removed in the code.
Workaround 3: According to this forum answer (and the Access team) you can rename the created TableDef to the desired local table name before you Append it. This also helps in many cases.
Workaround 4: by Philipp Stiefel
If you get error no 3001 "Invalid argument" when using CreateTableDef, then try this approach instead (of course adapted with your variables):
Set td = db.CreateTableDef()
td.Name = stLocalTableName
td.Connect = stConnect
td.Attributes = dbAttachSavePWD
td.SourceTableName = stRemoteTableName
db.TableDefs.Append td
It's confirm by me too...the bug is gone😎
Whith Version 2301 it is working again. The Problem is solved
Here is how I fixed the issue:
Rolling back the office version (DEC 10 version) fixed this bug for me:
This rolls back the office version (takes a few minutes):
Run the Command prompt in admin mode
C:\Windows\System32>cd..
C:\Windows>cd..
C:\>cd programfiles
The system cannot find the path specified.
C:\>cd %programfiles%\Common Files\Microsoft Shared\ClickToRun\
C:\Program Files\Common Files\microsoft shared\ClickToRun>officec2rclient.exe /update user updatetoversion=16.0.15831.20208
C:\Program Files\Common Files\microsoft shared\ClickToRun>
Alternatively, another client resolved the issue by changing the driver (I am told, but I have not tried it myself). Remove the 64-bit ODBC driver and replace it with the 32-bit version.
hi all. at the same time I encountered the issue with the LinkedTableName I'm also getting the Error "3001-Ungültiges Argument" when I try to to rellink all Tables from the Access BE Database. On Each Run the Error occures for different Tables! Any Idea what the Problem may be? With the previous Version this works still fine. So this also musst be introduced with the new released Version 2212. Regards, Igor
Can you point to where Microsoft have indicated a fix for the issue will be published with version 2301?