logo
search
Data Import & Export

How to Fix Excel Cannot Connect Directly to SQL Server but ODBC Works

WPS EditorWPS Editor Oct 1, 2026 869 views

Question details

Users are unable to connect Excel directly to a SQL Server database using the Get Data feature, even though the connection works fine using an ODBC data source.

How to Fix Excel Not Connecting Directly to SQL Server When ODBC Works
Product
Excel for Microsoft 365
Device & OS
not provided
Scenario
Importing database tables from SQL Server into a Microsoft Excel spreadsheet for data analysis.
Observed behavior
The direct SQL Server connection fails in Excel's Data > Get Data menu, but the same database can be accessed successfully through an ODBC configuration.
Before you start

Ensure you have Windows administrator privileges on your computer to modify ODBC Data Source settings and verify your SQL Server login credentials.

Solution 1Recommended

Configure the ODBC Connection under System DSN

Switching the connection from a User DSN to a System DSN ensures the driver architecture and system-wide permissions allow Excel to recognize and authenticate the connection.

Excel often struggles to retrieve data from User DSNs due to permission isolation in newer Windows architectures. Moving the connection to a System DSN resolves this.

1
Open ODBC Data Source Administrator

Press the Windows key, type 'ODBC Data Sources', and select the version (64-bit or 32-bit) that matches your Microsoft Excel installation architecture.

2
Navigate to the System DSN Tab

Click on the 'System DSN' tab at the top of the window instead of the default 'User DSN' tab.

3
Add a New Connection

Click the 'Add' button, select your SQL Server driver from the list, and click 'Finish'.

4
Configure Server Details

Enter a name for the connection, type in your SQL Server address, and proceed through the wizard to input your authentication credentials.

5
Test and Save

Click 'Test Data Source' to ensure the connection works, click 'OK' to save, and then restart Excel to try the Get Data function again.

Configure the ODBC Connection under System DSN
Administrator Rights: You will need Windows administrator privileges to create or modify a System DSN. If you are on a corporate network, you may need to contact your IT department.
Free Microsoft Office alternative

Experience Seamless Data Management with WPS Office

Struggling with complex Excel database connections and missing drivers? WPS Office offers a free, lightweight, and highly compatible alternative. Enjoy a familiar interface and seamless file management without the heavy troubleshooting.

  1. 1. Download WPS Office: Visit the official WPS website and download the free version for your operating system.
  2. 2. Install the Software: Run the setup file and complete the quick, lightweight installation process.
  3. 3. Open Your Spreadsheets: Launch WPS Spreadsheets and seamlessly open your existing .xlsx files to continue working on your data.
Highly compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Free, lightweight, and fast installation processFamiliar user interface with zero learning curveBuilt-in powerful data analysis and visualization tools
microsoft office alternative - wps office

Frequently Asked Questions

Why does my ODBC connection work but Excel's direct SQL connection fails?

Excel's direct 'Get Data' feature relies on different underlying data providers (such as the .NET Framework Data Provider for SQL Server) compared to a standard ODBC connection. If this specific provider is missing, outdated, or blocked by local permissions, the direct connection will fail even if standard ODBC traffic goes through.

What is the difference between a User DSN and a System DSN in ODBC?

A User DSN is only accessible by the specific Windows user profile that created it. A System DSN is accessible system-wide by any user or background service on that machine. Excel frequently requires a System DSN to properly authenticate and route database queries without permission conflicts.

How do I know if I am using 32-bit or 64-bit Excel?

Open Microsoft Excel, click on 'File', navigate to 'Account', and click 'About Excel'. The top line of the pop-up window will clearly specify whether you are running a 32-bit or 64-bit installation.

Which SQL Server driver should I use for Excel Microsoft 365?

It is highly recommended to use the latest Microsoft ODBC Driver for SQL Server (such as version 17 or 18) available from the official Microsoft download center. Make sure to download the specific bit-version (32-bit or 64-bit) that matches your Excel application, regardless of your Windows OS architecture.