Stop the ODBC Data Source Prompt in an Access Pass-Through Query
Question details
Configure an Access 2010 pass-through query to connect to SQL Server without asking users to select an ODBC data source.

- Product
- Microsoft Access 2010
- Device & OS
- not provided
- Scenario
- Users run a pass-through query that sends SQL to a SQL Server database.
- Observed behavior
- Access prompts users to select an ODBC data source when the query runs.
Identify the SQL Server name, database name, authentication method, and an installed SQL Server ODBC driver that matches the bitness of Access. Confirm that users have permission to connect to the database.
Set the query's ODBC connection string in Access
Use this method to save connection details with an existing pass-through query.
In the Access Navigation Pane, right-click the pass-through query and select SQL View.
Press F4 to open the Property Sheet. If necessary, click a blank area of the query window to display the query properties.
In ODBC Connect Str, enter a connection string for your server and database. For example, with Windows authentication and the SQL Server driver: ODBC;DRIVER={SQL Server};SERVER=your_server;DATABASE=your_database;Trusted_Connection=Yes;
Save the query, then run it from the Navigation Pane. Verify that it connects without displaying the data source selection prompt.

Set the QueryDef connection string in VBA
Use VBA to supply the connection string before opening or executing the saved query.
Work with Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and support for common Microsoft Office formats, making it easy to move everyday document and spreadsheet work. It does not configure Access pass-through queries or replace Access database connectivity.

Frequently Asked Questions
Where do I enter the connection string for an Access pass-through query?
Open the query in SQL View, press F4 to display its Property Sheet, and enter the string in ODBC Connect Str.
Do I need a named ODBC data source?
Not necessarily. A DSN-less connection string can specify the ODBC driver, server, database, and authentication settings directly in ODBC Connect Str.
Why does Access still prompt after I save the connection string?
The prompt may result from an incorrect driver or server name, unavailable network connection, missing credentials, or insufficient permissions. Check those settings and confirm that the driver's bitness matches Access.
Can I edit rows returned by a pass-through query?
Pass-through query result sets are generally read-only. To update data, run a suitable action query or server-side procedure with the required permissions.




