Jump to content

Recommended Posts

Posted

We have AutoIt code that performs a connection to an MS SQL database running SQL server 2012, tls 1.0. It has worked successfully for years.

Today, our IT department migrated our database to a new server that is running SQL server 2016, tls 1.2. Now our connection string is no longer working.

Here is the original that was working in SQL server 2012

$sConnStr = "DRIVER={SQL Server};SERVER=servername,port;DATABASE=dbname;UID=user;PWD=pass"

When that would run on the new server in SQL server 2016. We are getting the error [Microsoft][ODBC SQL Server Driver][DBNETLIB]SSL Security error

We tried changing the connection string to 

$sConnStr = "DRIVER={SQL Server Native Client 11.0};SERVER=servername,port;DATABASE=dbname;UID=user;PWD=pass"

The new error we received is [Microsoft]

TCP Provider: An existing connection was forcibly closed by the remote host.

We can log in successfully using SSMS using the server name, port and user/pass.

Any suggestions on what we need to change in order to get the connection to work again?

Posted

We finally found a solution that worked just by continuing to test different options. In case this helps anyone else, here is what we found that finally worked.

$sConnStr = "Provider=SQLNCLI11;SERVER=servername,port;DATABASE=dbname;DataTypeCompatibility=80;UID=user;PWD=pass"

 

Posted (edited)

Did you try my ADO.au3 UDF   ?

 

btw.
Thanks for sharing interestning soultion for problem with TLS.

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...