Microsoft KB Archive/110474

{|
 * width="100%"|

INF: SQL Server Drivers' Use of ODBC.INI and WIN.INI Files

 * }

Q110474

1.01.2807

WINDOWS

kbusage

-

The information in this article applies to:


 * Microsoft Open Database Connectivity, version 1.0

-

SUMMARY
This article discusses the connection mechanics of the SQL Server driver version 1.01.2807 and later. It shows how the various .INI file entries are used to make the connection and also how entries are made in the WIN.INI file when installing a data source with the driver.

MORE INFORMATION
The following ODBC.INI and WIN.INI files will be used in this section:

ODBC.INI
[ODBC Data Sources] InventorySQL=SQL Server

[InventorySQL] Driver=C:\WINDOWS\SYSTEM\sqlsrvr.dll Description=Inventory server for Corp. Server=INVSQL OemToAnsi=No

WIN.INI
[SQL Server] INVSQL=dbmsspx3,INVSQL When the SQL Server driver is loaded by the Driver Manager, because the InventorySQL data source has been chosen by the user, the SQL Server driver determines the server name by looking up the SERVER entry in the section for InventorySQL from the ODBC.INI file. The SQL Server driver then looks at the WIN.INI file[ASCII 146]s SQL Server Section to find an entry for INVSQL.

If it finds an entry for INVSQL, it loads the Network Library (Net- Library), dbmsspx3 in the above example, and passes the server name on the right hand side of the entry to the net-library. This net-library, dbmsspx3, then takes the server name INVSQL and resolves the name using network specific services, and connects to the SQL Server on the network.

In the above case, if there were no entry for INVSQL in the WIN.INI file, the SQL Server driver would then have checked for DSQUERY in the SQL Server section. If DSQUERY existed, as in the following WIN.INI file, the SQL Server driver would have loaded the net-library for DSQUERY (dbmsspx3 in the example below) and passed the server name INVSQL to it. The net- library, dbmsspx3, would then connect to the server as mentioned in the previous paragraph.

WIN.INI
[SQL Server] DSQUERY=dbmsspx3 Furthermore, if there were no entry for INVSQL in the WIN.INI file and if the DSQUERY entry does not exist in the WIN.INI file either, the SQL Server driver will by default load DBNMP3.DLL.

When setting up a SQL Server data source using the driver, if (Default) is chosen for the Network address and the Network library, the SQL Server driver will not make any entries in the WIN.INI file. However, if the network address and the network library are (default), and if and only if, the entries in the dialog box for Server and Data Source are the same, the entry for the data source will be removed from the WIN.INI file's SQL Server section. This may not be desirable in some cases. As a result, the best thing to do would be to setup the Data Source again, and this time do not use (Default) for network library and network address in the Setup Dialog Box. Instead use the installation-specific net-library and network address.

Additional query words: 1.01.2807

Keywords :

Issue type :

Technology : kbAudDeveloper kbODBCSearch kbODBC100