Installs a standard event handler for an Open Data Services 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).
SRV_HANDLE_PROC srv_handle (
SRV_SERVER * server,
DBINT event,
SRV_HANDLE_PROC handler );
This function should be defined as returning an int and taking a single parameter. This parameter should be defined as SRV_SERVER * when event is one of the following:
The parameter should be defined as SRV_PROC * when event is one of the following:
This function must return one of the following values.
Return value | Description |
---|---|
SRV_CONTINUE | Continue normal processing. |
SRV_DISCONNECT | Fire a disconnect event to close the client connection. |
SRV_EXIT | Shuts down the server completely. |
A pointer to the previously defined event-handling function.
When an event occurs, Open Data Services calls the following functions in this order:
Each Open Data Services event has a default standard event handler that returns SRV_CONTINUE. Installing a standard event handler with srv_handle replaces the default handler with one supplied by the application.
You can install standard event handlers dynamically. The new standard event handler is called when the next event occurs. An Open Data Services application can have one standard event handler for each event. Open Data Services automatically removes the event handler when necessary; the application should not attempt to do this.
srv_event | srv_pre_handle |
srv_post_handle |