After Office update version 2312 that was released yesterday Jan 4, 2024, MS Access TableDef.Connect is returning the connection string with a missing semicolon.
ODBCDRIVER=SQL Server;SERVER=Server01\SQLEXPRESS2008R2;UID=sa;PWD=Password;APP=Microsoft Office;DATABASE=LauDatabase
The MS Access that is not updated to version 2312 is returning this with TableDef.Connect
ODBC;DRIVER=SQL Server;SERVER=Server01\SQLEXPRESS2008R2;UID=sa;PWD=Password;APP=Microsoft Office;DATABASE=LauDatabase
This seems to be a bug that was introduced in Office update version 2312. We have multiple customers with this issue. There does not seem to be an issue with the odbc connection, the link table opens fine without any issues. I have tried recreating the DSN to sql server without any luck. Here is the function that returns the connection of a table using TableDef.
Public Function TestGetConnectionString() As String
Dim db As DAO.Database
Set db = CurrentDb
Dim td As TableDef
Set td = db.TableDefs("tblSetup")
TestGetConnectionString = td.Connect
End Function