Back To Main Page

Free Downloads

Learn VB - Free Guide

Knowledgebase Articles

SQL Hints and Tips

Specify Network Library

Client machines connecting to a SQL Server database need to have the SQL Server driver installed on them in order for them to connect. When this is first installed/setup the default network library that your application will use is Named Pipes.

If you are developing applications for an organisation that has different subnets, you will find that unless your application uses TCP/IP as the network library, they will not be able to connect to the database if its on a separate subnet. Potentially you could go around each machine changing the default Network Library to TCP/IP from Named Pipes, but this could be a long job.

However, there is an alternative and that is to add a paramter to, for example, an ADO connection string which specifies the network library to use. The possibilies are:

  • dbnmpntw - Win32 Named Pipes
  • dbmssocn - Win32 Winsock TCP/IP
  • dbmsspxn - Win32 SPX/IPX
  • dbmsvinn - Win32 Banyan Vines
  • dbmsrpcn - Win32 Multi-Protocol (Windows RPC)

So to use TCP/IP as your Network Library from VB (when using ADO), try the following in your ADO connection string:

"Driver={SQL Server};Server=MyServer;...........pwd=;NetworkLibrary=dbmssocn;"

If on the other hand you wanted to use IPX/SPX, then you've use a connection string similar to:

"Driver={SQL Server};Server=MyServer;...........pwd=;NetworkLibrary=dbmsspxn;"