I've got a VB script which connects to some local SQL database to retrieve something. The identical script operates on about 100 servers, but a couple of from the servers produce this error:

[DBNETLIB][ConnectionOpen (PreLoginHandshake()).]General network error. Look at your network documentation

This is actually the code that runs:

Function GetPrimaryServerID
On Error Resume Next
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=SQLOLEDB;Data Source=127.0.0.1;Initial Catalog=xxx;User ID=xxx;Password=xxx"
sqlquery = "SELECT ServerID FROM tblSettings"
objRecordSet.Open sqlquery,objConnection
objRecordSet.MoveFirst
GetPrimaryServerID = objRecordSet("ServerID")
objRecordSet.Close
objConnection.Close 
End Function

The mistake happens around the fifth line when attempting to spread out the bond string. I am confused why this script is focusing on almost all servers and failing on merely a handful. The database they connect with is similar on every server when it comes to structure, its just the data that changes.

Fixed the issue by doing the next: Opened up SQL Server Configuration Manager and visited Methods for MSSQLSERVER -> TCP/IP. Within the 'IP Addresses' tab, I observed that IP2 that has address of 127...1 was active although not enabled. Transformed to enabled and restarted SQL services. My VB script now effectively opens the bond to 127...1.

It isn't a database error, but a customer tools or config error

The failing servers will most likely:

  • possess a different degree of either SQL Server install /includes service pack)
  • are set up for Home windows Authentication only
  • come with an older MDAC (associated with SQL Service pack, OS Service pack etc)

Edit:

SQL Server SSL File encryption, server side, is described here. As well as in KB 316898 too

  • "Server side" requires merely a server certificate and all sorts of connections are encoded
  • "client side" requires client certs and it is optional, and just for your client

Certain client libraries (particularly MS JDBC) don't support this.

If I have suspected right, you will have either client or server SSL file encryption set in line with the server (your script is serving as a customer)

It might fail when the database isn't set up to hear TCP/IP traffic. The mistake "Named Pipes Provider, error: - No process is alternatively finish from the pipe." points for the reason that direction.

You can look at by using:

telnet 127.0.0.1 1433

To configure in which the server listens, use `SQL Server Network Utility" for SQL Server 2000, or "SQL Server Area Configuration" for SQL Server 2005 or more.