As mentioned at Utter Access forum, I have the same issue and reported it to the Access team yesterday. I have already had an acknowledgement of the issue and will report back on the timescale for a fix once I am able to do so.
RefreshLink has started failing with Error 3611 - Version 2312 (Build 17126.20014)
Having posted in the Community forum, it has been suggested that this is a better place to ask my question.
I have a split Access database that has started raising Error 3611 (Cannot execute data definition statements on linked data sources) in the frontend VBA code that refreshes links to tables in the backend. The statement that fails is RefreshLink.
We are currently using 32-bit Access, Microsoft 365 Version 2312 (Build 17126.20014) and get updates via the Current Channel. I was updated to this version yesterday (Dec-6-2023), before this I believe I was on Version 2311.
My question is why would RefreshLink complain that data definition statements are being executed?
The easiest way to replicate the error is with a copy of the Northwind Dev Edition sample database. Then create a new database and use External Data -> New Data Source -> From Database -> Access to create links to some tables in the Northwind database. Then place the following function in a module.
Function Relink()
Dim Idx As Long
Dim pos As Long
Dim strPath As String
Dim strFileName As String
Dim strConn As String
Dim strReconn As String
Dim db As DAO.Database
Dim tdf As DAO.TableDef
strPath = CurrentProject.Path
Set db = CurrentDb
For Idx = 0 To db.TableDefs.Count - 1
'Get connect string from tabledef
Set tdf = db.TableDefs(Idx)
strConn = tdf.Connect
'Find linked tables
If Left(strConn, 10) = ";DATABASE=" Then
'Build string to reconnect to local database
pos = InStrRev(strConn, "\")
strFileName = Right$(strConn, (Len(strConn) - (pos - 1)))
strReconn = ";DATABASE=" & strPath & strFileName
'Relink to local database
tdf.Connect = strReconn
tdf.RefreshLink 'Errors with 3611 in v2312
End If
Next Idx
Set tdf = Nothing
Set db = Nothing
End Function
Save this database in the same folder as the Northwind database. With Version 2312 when you run the Relink function it will fail with Error 3611. I execute the code from the Visual Basic editor.
This looks to be a bug in version 2312, or has there been a change to the behaviour of the RefreshLink statement? If it's not a bug what am I doing wrong?
Any help or guidance would be appreciated.
2 additional answers
Sort by: Most helpful
-
DaveBWC 20 Reputation points
2023-12-10T10:52:30.71+00:00 Post on Utter Access forum reports that this is indeed a bug and has been confirmed by the Access team that it will be fixed before Version 2312 is released to the Current Channel.
-
Colin Riddington 85 Reputation points
2023-12-24T23:36:25.6366667+00:00 Sorry - forgot to report back earlier.
This error was fixed on Mon 11 Dec - see https://isladogs.co.uk/error-3611-refresh-links/