top of page

Missing Semicolon in ODBC Connect (Fixed)

Updated: Jan 11

Description

There are several reports of a new bug when relinking ODBC tables in version 2312 Build 17126.20126 released to the Current Channel on January 4, 2024. For example, see these threads:


The bug causes the Connect property of the TableDef object of a linked ODBC table to return a value different from the actual connection string. The semicolon after the “ODBC” prefix of the connection string is missing.

Also, the RefreshLink method of the TableDef object appears to use a similarly incorrect connection string and thus fails to refresh the definition of the table. Examples:


ODBC;DRIVER=ODBC Driver 17 for SQL Server;SERVER=XXX;...

becomes

ODBCDRIVER=ODBC Driver 17 for SQL Server;SERVER=XXX;...


If you use a DSN:

ODBC;DSN=DsnName;...

becomes

ODBCDSN=DsnName;...


Creating new linked ODBC tables with either …

DoCmd.TransferDatabase acLink, "ODBC Database","ODBC;DSN=DsnName;...

… or …

Set td = db.CreateTableDef()
td.Connect = "ODBC;DSN=DsnName...

is not affected by the bug and still works as expected. This also applies to DSNless connection strings including the DRIVER keyword directly.


Cause

It looks like a regression in version 2312. The latest builds on the Insider channels also appear to be affected.


Status

The bug was first reported to Microsoft on the same day version 2312 was released. The Access team responded immediately that they are working on a fix.


Build 17126.20132 released to the Current channel on January 9 fixes this bug.


Note: This new build initially created performance/delay issues when using the old SQL Server ODBC driver. This problem should now be resolved. There is no new build. It should be enough to restart Access for the performance problems to disappear.


Until you get the semicolon fix, there are 2 potential workarounds:


Workaround 1

If you use ODBC links (DSN or DSN-less) try not to install version 2312 until the fix is released or roll back to version 2311 if you have already done so.


Workaround 2

Modify code that depends on the Connect property value to reset the missing semicolon, for example:

Replace(CurrentDb.TableDefs("TableName").Connect, _
							"ODBCDRIVER=", "ODBC;DRIVER=")

As the first parameter after the "ODBC" prefix can differ, check which one it is in your specific Connect property string and adapt the replacement construct to your requirements.

1,571 views18 comments

Recent Posts

See All
bottom of page