title: TCP Provider: An existing connection was forcibly closed by the remote host
body: <p>I'm having problems with SQL clients randomly disconnecting from the server with a TCP connection forcibly closed error message.</p>
  
  <p>Setup is as follows:</p>
  
  <ul>
  <li>SQL 2014 Express running on Windows Server 2008.</li>
  <li>Clients are Wi-Fi connected Microsoft Surface 3-Standard or 4-PRO's,
  running Windows 10 release 1703.</li>
  <li>Wi-Fi infrastructure in most cases is Aruba AP-105's, a few Cisco
  AP's around in some locations.</li>
  <li>The client application (written in VB6, using SQLNCLI 11 database
  drivers) is regularly making connections to the SQL server (every 15
  seconds or so).</li>
  </ul>
  
  <p>Randomly the SQL connection will drop, reporting</p>
  
  <ul>
  <li>"TCP Provider: An existing connection was forcibly closed by the
  remote host."</li>
  </ul>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>So, can anyone suggest what might be going on?</p>
  
  <p>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.</p>
  
  <p>Connection string as follows:</p>
  
  <pre><code>sqlConnectionString = "Provider=SQLNCLI11;" &amp; _
                        "Server=" &amp; gblSQLDataSource &amp; ";" &amp; _
                        "Database=" &amp; strDB &amp; ";" &amp; _
                        "Uid=" &amp; oUser.DecryptSQLUser &amp; ";" &amp; _
                        "Pwd=" &amp; oUser.DecryptSQLPass &amp; ";" &amp; _
                        "MARS Connection=True;" &amp; _
                        "DataTypeCompatibility=80;"
  </code></pre>
  
  <p>Jim</p>