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

Jim picture Jim · Jan 17, 2018 · Viewed 15.8k times · Source

I'm having problems with SQL clients randomly disconnecting from the server with a TCP connection forcibly closed error message.

Setup is as follows:

  • SQL 2014 Express running on Windows Server 2008.
  • Clients are Wi-Fi connected Microsoft Surface 3-Standard or 4-PRO's, running Windows 10 release 1703.
  • Wi-Fi infrastructure in most cases is Aruba AP-105's, a few Cisco AP's around in some locations.
  • The client application (written in VB6, using SQLNCLI 11 database drivers) is regularly making connections to the SQL server (every 15 seconds or so).

Randomly the SQL connection will drop, reporting

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

This can occur at any time (including int he middle of using the application), not necessarily after the PC has been dormant for a period of time.

We have some clients on hard-wired LAN connections and these never drop the connection, leading us to believe the problem is related to brief Wi-Fi dropouts.

In testing we cannot reproduce the error, the software recovers even when turning the Wi-Fi off (and any other LAN disturbance we can think of) and back on with no indication of the fault.

Google has been very "helpful" and there are many references to this issue, often referring to TCP Chimney Offload settings on the server. Once we understood what these were all about they were tried, but have not made any difference.

So, can anyone suggest what might be going on?

We've historically used the SQLOLEDB drivers and were getting "General network failure" errors (not particularly helpful!), switched to SQLNCLI to see if it improved the situation, which it didn't, but did expose the real error message.

Connection string as follows:

sqlConnectionString = "Provider=SQLNCLI11;" & _
                      "Server=" & gblSQLDataSource & ";" & _
                      "Database=" & strDB & ";" & _
                      "Uid=" & oUser.DecryptSQLUser & ";" & _
                      "Pwd=" & oUser.DecryptSQLPass & ";" & _
                      "MARS Connection=True;" & _
                      "DataTypeCompatibility=80;"

Jim

Answer