The information in this article applies to:
- Microsoft SQL Server, version 6.5
- Microsoft SQL Server Programmer's Toolkit, version 6.5
- Microsoft Open Database Connectivity, versions 2.5 and 3.0
SUMMARY
This article describes a quick method of setting up the ODBC Open Data
Services (ODS) Data Source and the Gateway sample application on a
computer
running Windows NT Server 4.0 that is also running SQL Server 6.5. This
article assumes that you have installed and successfully compiled the ODS
Sample applications provided in the Programmers Tool Kit (PTK),
specifically the Gateway.exe and the Odssamp.dll files. SQL Server must
also be configured to use named pipes, and the console should have named
pipes as the default network library. This example is based on the Intel
processor version.
MORE INFORMATION
- Copy the Odsgt32.dll file from the PTK\I386 directory to the
Winnt\System32 directory. Copy the Odssamp.dll file that was built from
the Samples\Ods\Odsodbc project to the Winnt\System32 directory.
- Start Regedt32 and go to HKey_Local_Machine on Local Machine to the
Software\Microsoft\Mssqlserver\Mssqlserver key. Save this key as
Gateway.key. On the Edit menu, click Add Key. Add a key called
Software\Microsoft\Mssqlserver\Gateway, but leave the class blank.
Select the Gateway key and restore the contents of Gateway.key into it.
Answer Yes to the warning about overwriting the key with the values of
the file.
- Remove the Software\Microsoft\Mssqlserver\Gateway\CurrentVersion,
Software\Microsoft\Mssqlserver\Gateway\Parameters and
Software\Microsoft\Mssqlserver\Gateway\RPCNetLib keys. Open the
Software\Microsoft\Mssqlserver\Gateway folder, and remove all the key's
values, except the ListenOn value. Double-click the ListenOn value and
change it to the following server-side library and pipe:
ListenOn: Reg_Multi_SZ:SSNMPN60,\\.\pipe\gateway\query
- Using the Client Configuration Utility, select the Advanced section and
enter the following:
Server: GATEWAY
DLL Name: Named Pipes
Connection String: \\.\pipe\gateway\query
Click Add/Modify and use Regedt32 to verify that the settings in the
Software\Microsoft\Mssqlserver\Client\Connectto key are as follows:
GATEWAY: REG_SZ: dbnmpntw,\\.\pipe\gateway\query
- In Regedt32, go to HKEY_LOCAL_MACHINE\Software\Odbc\Odbc.ini on Local
Machine. Add the following value to the ODBC Data Sources folder:
GATEWAY: REG_SZ: GATEWAY
Next, add a key named "GATEWAY" to the HKEY_LOCAL_MACHINE\Software\
Odbc\Odbc.ini key. This new key can be populated by the LocalServer
key.
Save it, and then restore the resulting file in the GATEWAY Key. The
following key values that are not marked are not required. Those values
that are required are marked below:
Database: REG_SZ: pubs
Description: REG_SZ:
Required ----------> Driver: REG_SZ: C:\WINNT40\System32\odsgt32.dll
Required -> GatewayResource: REG_SZ: C:\WINNT40\System32\
(you must add it) Odssamp.dll
Language: REG_SZ:
LastUser: REG_SZ: sa
Required -------> OEMTOANSI: REG_SZ: No
Required ----------> Server: REG_SZ: GATEWAY
Trusted_Connection: REG_SZ:
UseProcForPrepare: REG_SZ: No
Start SQL Server. Start the gateway application from a console window
as follows:
gateway -RGATEWAY -SMyServerName
Using either MSQuery or ODBCTest, connect using the defined DSN. In the
Gateway console window, verify that the connection has been made.
|