MS Access re-uses already established ODBC connections, disregarding differing connection parameters
04:52 11 Aug 2026

MS Access seems to re-use already established ODBC connections, disregarding differing connection parameters, when using multiple Linked Tables.

I suspect this happens with EVERY kind of database server in the background, but here I have tested it with SQL Server, although my first suspicion came when using PostgreSQL quite a while ago. I had two PostgreSQL servers on the same host, and MS Access was somehow mixing them up, as far as I remember.

Has anybody experienced the same behaviour? Is this documented anywhere on the internet? How to mitigate that?

To reproduce, I assembled the following VBA code. Please fill in your server and your credentials to a SQL Server instead of ***.

Sub mssql_test()
    Const tableName = "***"
    Const sourceTableName = "***"
    Const sqlServerHostname = "***"
    Const database = "***"
    Dim db As database
    Set db = CurrentDb
            
        
    'DB Connection with invalid credentials
    Dim td1 As New TableDef
    With td1
        .Name = tableName & "1"
        .sourceTableName = sourceTableName
        .Connect = "ODBC;DRIVER=SQL Server;SERVER=" & sqlServerHostname & ";DATABASE=" & database _
            & ";UID=myWrongUsername;Pwd=myWrongPassword"
    End With
    db.TableDefs.Append td1
    
    
    
    'DB Connection with valid credentials
    Dim td0 As New TableDef
    With td0
        .Name = tableName & "0"
        .sourceTableName = sourceTableName
        .Connect = "ODBC;DRIVER=SQL Server;SERVER=" & sqlServerHostname & ";DATABASE=" & database _
            & ";Integrated Security=true"
    End With
    db.TableDefs.Append td0
End Sub

The code will fail in the td1 block, of course. Because we intentionally gave wrong credentials.

But now exchange the td0 and td1 code blocks and execute again. It will run without errors and successfully link both tables. My interpretation: Because the td1 block with the WRONG credentials simply re-uses the connection from the td0 block with VALID credentials. What gives?

Further investigation using TCPView showed me: MS Access keeps the connection open even if you close and re-open the ACCDB file in the same access instance. So even then MS Access uses the cached connection with potentially differing parameters. Yuo have to close the MS Access instance to force MS Access to use new connection parameters.

ms-access connection-string connection-pooling linked-tables