How to Create Stable DSN-Less MS Access Connections to SQL Server
Question details
The user wants to establish reliable, DSN-less connections from Microsoft Access to SQL Server without constantly deleting and recreating linked tables.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Reconnecting or updating connections to SQL Server databases within Microsoft Access when server or database credentials change.
- Observed behavior
- Repeatedly deleting and recreating linked Access tables causes database inefficiency, application overhead, and connection stability issues.
Ensure that you have administrative access to the SQL Server database and have backed up your local Microsoft Access front-end before making structural VBA code changes.
Update the TableDef.Connect Property Dynamically
Reuse existing TableDef objects and update their Connect properties to improve connection stability and database efficiency.
When a table-linking loop creates a new TableDef for each entry in a local configuration table, it causes unnecessary database bloat. You only need to create a new TableDef for an entirely new linked table.
For existing links, modifying the Connect property dynamically avoids the inefficiency of deleting and recreating linked tables. This method is effective even when you merely need to detect new fields in the SQL Server table.
Press ALT + F11 in Microsoft Access to open the Visual Basic for Applications (VBA) editor.
Find the module or subroutine that loops through your local configuration tables to establish SQL Server connections.
Modify your code to check if the target table already exists in the CurrentDb.TableDefs collection before attempting to create it.
If the table exists, update the connection string by assigning your new DSN-less string directly to CurrentDb.TableDefs("YourTableName").Connect.
Call the CurrentDb.TableDefs("YourTableName").RefreshLink method to instantly apply the new connection and pull in any structural changes from the server.

Upgrade to Microsoft ODBC Driver 18 for SQL Server
Replace outdated legacy SQL Server ODBC drivers with a current version to prevent connection string drops and improve reliability.
Switch to WPS Office for a Lightweight Document Workflow
While Microsoft Access manages specialized databases, handling your daily documents, spreadsheets, and presentations is effortless with WPS Office. It provides a comprehensive, lightweight, and completely free alternative to heavy Microsoft Office suites.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Suite: Run the installer and follow the on-screen prompts to set up WPS Office on your computer.
- 3. Open Your Office Files: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint documents without losing any formatting.

Frequently Asked Questions
What is a DSN-less connection in Microsoft Access?
A DSN-less connection allows Microsoft Access to connect to a database like SQL Server by specifying all driver, server, and credential details directly within the connection string in code. This removes the need to manually configure a local Data Source Name (DSN) on every user's computer.
Why is deleting and recreating linked tables considered bad practice?
Constantly deleting and recreating linked tables increases database bloat, slows down application performance, and can lead to connection instability or corruption over time. Updating the Connect property is a much cleaner, faster, and safer approach.
Do I need to recreate my TableDef to detect new fields in SQL Server?
No. Recreating links is not required merely to detect new fields. Updating the Connect property and calling the RefreshLink method will successfully pull down and reflect any newly added fields from the SQL Server table.
Which ODBC driver should I use for SQL Server connections?
It is highly recommended to use the latest Microsoft ODBC Driver for SQL Server, such as ODBC Driver 18. Avoid using legacy 'SQL Server' drivers to ensure maximum security, performance, and stability for your database connections.




