This article discusses where you can find information on specifying thenetwork parameters when you configure ODBC data sources for the MicrosoftSQL Server ODBC Driver. This information applies only to the Microsoft SQLServer ODBC Driver; users of other vendors' SQL Server drivers shouldconsult the vendors' documentation for those drivers.
The Microsoft SQL Server ODBC driver uses the same basic mechanism toestablish connections to SQL Server as is used by applications using SQLServer's proprietary DBLIB API. Both DBLIB clients and the Microsoft SQLServer ODBC driver communicate to the underlying network through a SQLServer network library. There is a network library for each of the networkprotocols SQL Server can use for client/server communications. The purposeof the network library is to take generic requests from DBLIB or the ODBCdriver and encapsulate those requests in the packets of the underlyingnetwork. When you configure an ODBC data source for the Microsoft driver,you must provide the driver with the same information regarding networklibraries as you provide to DBLIB applications.
The connectivity parameters for SQL Server DBLIB applications are definedusing the SQL Server Client Configuration Utility. The best description ofthe parameters that must be specified in the Client Configuration Utilityis in the SQL Server version 6.0 or 6.5 "Administrator's Companion,"Chapter 4, Configuring Clients. The basic information is also discussed inthe SQL Server 4.21a "Configuration Guide," Chapter 3, "Client Installationand Configuration."
If you want to configure your ODBC data sources for the Microsoft SQLServer driver, you must first understand how to manage the entries in theClient Configuration Utility. You should first review the materialreferenced above, and then use the Client Configuration Utility to defineconnections and test them with the SQL Server DBLIB-based utilities, suchas ISQL/w.
You need to have the SQL Server client utilities installed on your clientto gain access to the Client Configuration Utility and the other utilitiessuch as ISQL/w. It is also usually necessary to install the SQL Serverclient utilities if you want to use any network protocol other than namedpipes to connect to SQL Server from your ODBC application. Most productswhich install the Microsoft SQL Server ODBC Driver only install the namedpipes network library; in these cases, the only way you can get the othernetwork libraries for SQL Server is to install the SQL Server clientutilities.
Once you understand how to define SQL Server advanced network entrieswith the Client Configuration Utility, it is easy to configure ODBCentries for the Microsoft driver. You can configure ODBC data source names(DSNs) either by using the ODBC Administrator or calling theSQLConfigDataSource function. There is a direct correspondencebetween ODBC Administrator, SQLConfigDataSource, and Client ConfigurationUtility parameters as follows:
ODBC Administrator SQLConfigDataSource Client Config Utility------------------ ------------------- ---------------------Server SERVER ServerNetwork Library NETWORK DLLNetwork Address ADDRESS Connection String
It is important that data sources you define for the Win32 SQL Serverdriver always reference a Win32 network library, and data sources for theWin16 SQL Server driver always reference Win16 network libraries:
Type Driver Network Libraries----- -------- ------------------------------------------------Win32 SQLSRV32 DBMSSOCN, DBMSSPXN, DBMSVINN, DBMSRPCN, DBNMPNTWWin16 SQLSRVR DBMSSOC3, DBMSSPX3, DBMSVIN3, DBMSRPC3, DBNMP3
The connection information from an ODBC data source is stored in the samelocation and format as a Client Configuration Utility advanced cliententry. After you define an ODBC DSN, its connection entry will show up asan advanced entry in the Client Configuration Utility, and DBLIB clientscould use the server name to connect to SQL Server.
There are a couple of special cases regarding the parameters for ODBCdata sources. If you want a data source that will always connect to aserver using the current default network library defined with the ClientConfiguration Utility, you should specify:
Server <servername> Network Library (default) Network Address (default)
where <servername> is the network name of the Windows NT server runningSQL Server. Any DSN set up this way should work at sites that have notinstalled the SQL Server Client Utilities because the ODBC driver willdefault to the named pipes network library, which is installed by allproducts that install the Microsoft driver.
If the ODBC application is on the same server as SQL Server, the followingdata source will connect using local named pipes:
Server (local)Network Library (default)Network Address (default)
NOTE: (local) and (default) should be keyed in exactly as shown, includingthe parenthesis.