'Connection to SQL database failed because of an error in initializing provider

I am trying to connect to an internal SQL database which allows TLS 1.2 protocol only.

I am able to log-in to the database using the SQL Server Management studio.

I'd like to connect to that same database using Excel 2013 (for a more graphic report). I have read a lot on Excel having problems with TLS1.2 and the use of ODBC Driver instead since that is the only one which supports tls 1.2.

Sadly when entering the credentials and testing the connection we receive the following error:

TEST CONNECTION FAILED BECAUSE OF AN ERROR ININITIALIZING PROVIDER. UNSPECIFIED ERROR

Does anybody have experience with using Excel to connect to SQL Server using TLS1.2? Am I doing something wrong? I'm using the Data link: Microsoft OLE DB Provider for ODBC drivers. The normal SQL way of adding things doesn't work either but I believe that's because TLS1.2 isn't supported there.



Solution 1:[1]

If I recall correctly, Management Studio will connect on port 1433 by default and use the TDS protocol and really have nothing to do with TLS. So it is not surprising that it works in SSMS.

From https://blogs.msdn.microsoft.com/sql_pfe_blog/2017/09/27/microsoft-excel-tls-sql-server-important-considerations/

For all NEW workbooks, do not use that menu option. Instead use the "From Data Connection Wizard" and select a compliant driver from the list. A requirement is that you have the SQL Native Client (2008 or 2012) or ODBC drivers with appropriate patches per TLS 1.2 support for Microsoft SQL Server below.

So it seems like just using ODBC will not work unless ODBC on your machine has been patched to handle TLS 1.2.

I believe the ODBC update you need is below.

https://www.microsoft.com/en-us/download/details.aspx?id=36434&751be11f-ede8-5a0c-058c-2ee190a24fa6=True

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 thomas