Thursday, May 7, 2009

[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation.

have a web site and using SQL Server 2000 as my back end DB. The ASP page connect to SQL Server through ODBC connection using DSN configured using TCP/IP protocol. and after couple of windows update website page was showing network errror when it was trying to get the infomation from the SQL Server.

Below is the error message getting displayed


[Microsoft][ODBC SQL Server Driver][DBMSSOCN] General Network error. Check your documentation.
Connection failed:
SQLState: '01000'
SQL Server Error: 10061
[Microsoft][ODBC SQL Server Driver][DBMSSOCN]ConnectionOpen(connect())
Connection failed:
SQLState: 08001
SQL Server Error: 11
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation.
Connection failed:
SQLState: 01000
SQL Server Error: 10061
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen (connect())

cause: exceeded the default WinsockListenBacklog setting on the computer that is running SQL Server.

A Winsock application accepts connections on a port by calling a Listen() function, which has a backlog parameter specifying the maximum length of the pending-connection queue. The Winsock specification defines the maximum Listen() backlog at five and when it exceeds five, TCP/IP issues a reset.

and due to this we see the below error message

[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation.


Solution:

Start Registry Editor (REGEDT32.EXE) and locate the following subkey:

For a default instance:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib

For a named instance:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Name\MSSQLServer\SuperSocketNetLib

select the SuperSocketNetLib for SQL Server 2000. On the Edit menu, click Add Value.

Enter the following:

Value Name: WinsockListenBacklog
Data Type: REG_DWORD
Data: Range is 1 to 0xFFFFFFFF

in my case i had set the value of Data:15, that resolved the issue.

Note: The suggested method of testing with this value is to set the value in increments of five and observe the results until the connection reset stops.

once value is set, Restart SQL Server.

No comments: