srv_init

Initializes an Open Data Services server application.


Important This Open Data Services function or macro is only supported in Microsoft® SQL Server™ version 7.0 for backward compatibility.


For more information about Open Data Services functions or macros supported for backward compatibility, see Open Data Services (Level 3).

Syntax

SRV_SERVER * srv_init (
SRV_CONFIG * config,
DBCHAR * server_name,
int namelen );

Arguments
config
Is a pointer to the SRV_CONFIG structure that contains the values for the configuration options used by the Open Data Services server application.
server_name
Specifies the Registry key where Open Data Services can find the Microsoft Windows NT® Registry ListenOn value with the appropriate connection string data for this server application process:

HKEY_LOCAL_MACHINE\
SOFTWARE\
Microsoft\
MSSQLServer\
server_name

If no ListenOn multistring value has been entered at the specified registration key or if server_name is NULL, Open Data Services then looks in the registration key:

HKEY_LOCAL_MACHINE\
SOFTWARE\
Microsoft\
MSSQLServer\
Server

If this key also has no ListenOn value, then by default, Open Data Services loads the server Named Pipes Net-Library DLL (Ssnmpntw.dll) that only uses the default named pipe \\.\Pipe\Sql\Query.

The following example shows connection string data that might appear for a Windows NT ListenOn multistring value:

SSNMPN60,\\.\PIPE\SQL\APPNAME

SSMSSO60,1433

  

The first connection string is an instruction to load the server Named Pipes Net-Library (Ssnmpn60.dll) with the pipe name \Pipe\Sql\Appname. The second connection string is an instruction to load the server TCP/IP Sockets Net-Library (Ssmsso60.dll) with the TCP/IP port number 1433. You can use the Windows NT - based program regedt32 to view and edit the entries in the Windows NT Registry.

namelen
Specifies the length, in bytes, of server_name. If the namelen parameter is SRV_NULLTERM, then the server_name string must be null-terminated.
Returns

A pointer to a SRV_SERVER structure. If the server cannot be initialized, returns NULL.

Remarks

The initialization process consists primarily of allocating the necessary data structures for the server and initializing the server state.

To use values other than the defaults, use the srv_config function before calling srv_init.

A server must be initialized before being started with srv_run.

See Also
srv_config srv_run
srv_config_alloc  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.