Installs a pre-event handler for an extended stored procedure called before the standard event handler.
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).
int srv_pre_handle (
SRV_SERVER * server,
SRV_PROC * srvproc,
DBINT event,
SRV_PRE_HANDLE_PROC handler,
BOOL remove );
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 | Fire a disconnect event to close the client connection. |
SRV_SKIP | Skip execution of the standard event handler. The post-event handler is still executed. |
A pointer to the previously defined pre-event-handling function.
When an event occurs, Open Data Services calls the following functions in this order:
You can install pre-event handlers dynamically. The new pre-event handler is called when the next event occurs. For each event, an extended stored procedure application can have multiple global pre-event handlers, and multiple pre-event handlers per client connection, but you cannot install the same pre-event handler function multiple times for the same event value. Open Data Services automatically removes the post-event handler when necessary; the application should not attempt to do this.
srv_handle |