srv_setuserdata

Saves a pointer to private data space in a SRV_PROC structure.


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

int srv_setuserdata (
SRV_PROC * srvproc,
void * ptr );

Arguments
srvproc
Is a pointer to the SRV_PROC structure that is the handle for a particular client connection. The structure contains information the ODS Library uses to manage communication and data between the Open Data Services server application and the client.
ptr
Is a pointer to the private data space for Open Data Services processes.
Returns

SUCCEED or FAIL.

Remarks

The ODS Library passes the current SRV_PROC structure to most event handlers. A pointer to user data can be saved in the SRV_PROC structure by using srv_setuserdata. This pointer to user data allows Open Data Services server applications access private data without using global or static variables to hold private data. Open Data Services applications can then be reentrant.

The ptr pointer is not manipulated in any way by the ODS Library. It is provided only for the convenience of Open Data Services developers. The data that ptr points to can be allocated at connect time and accessed later by using srv_getuserdata.

See Also
srv_getuserdata  

  


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