Forum Discussion
ODBC from Access to SQL Server database - query timeout expired
Tom_van_Stiphout George_Hepworth credentials work great with SSMS, all tables are visible - still not with ODBC.
- Tom_van_StiphoutOct 21, 2023Iron ContributorUse the ODBC applet (under Control Panel) to create a File DSN using the same ODBC driver. On the last page of the wizard you can test the connection. Does that work?
- danevaldOct 23, 2023Copper ContributorIt's the same as creating it through Access, and the test completes successfully.
- George_HepworthOct 23, 2023Silver Contributor
I don't recall. Did you ask the DBA for this SQL Server for assistance? In fact, we ought to be clear on where this SQL Server is located, local or remotely hosted.
One other thing comes to mind, which I probably should have thought of previously. Depending on where this SQL Server is, local or hosted, it may be that you have to specify that the connection needs to trust the Server Certificate to which it's connecting.
Note the elements of this connection string for a table linked in Access, for example, especially the last one.
DRIVER=ODBC Driver 18 for SQL Server; SERVER=YourServerNameGoesHere;UID=YourUserIDGoesHere;PWD=YourPasswordGoesHere;Trusted_Connection=No;APP=LocalApplicationName;DATABASE=YourSSDatabaseNameGoesHere;Encrypt=Yes;TrustServerCertificate=Yes;
TrustServerCertificate is being required by more hosts, as well as by SQL Azure. I have been caught out by it at least a couple of times in the last 6 months.