srv_init

Initializes an Open Data Services server application.

Syntax

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

where

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.
servername
Specifies the Registry key:

HKEY_LOCAL_MACHINE\
SOFTWARE\
Microsoft\
MSSQLServer\
servername

where Open Data Services can find the Windows NT Registry ListenOn value with the appropriate connection string data for this server application process. If no ListenOn multi-string value has been entered at the specified registration key or if servername 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 named pipes server Net-Library DLL (SSNMPNTW.DLL) only, using the default named pipe \\.\pipe\sql\query.

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

SSNMPN60,\\.\PIPE\SQL\APPNAME
SSMSSO60,1433

The first connection string is an instruction to load the named pipes server Net-Library (SSNMPN60.DLL) with the pipe name \pipe\sql\appname. The second connection string is an instruction to load the TCP/IP sockets server Net-Library (SSMSSO60.DLL) with the TCP/IP port number 3180. 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 servername. If the namelen parameter is SRV_NULLTERM, then the servername string must be null-terminated.

Returns

A pointer to an SRV_SERVER structure. If the server can't 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

This entry For information about
srv_config Setting the server configuration parameters
srv_config_alloc Allocating an SRV_CONFIG structure
srv_run Starting an Open Data Services server application