dbgetuserdata

Returns a pointer to user-allocated data from a DBPROCESS structure.

Syntax

LPVOID dbgetuserdata ( PDBPROCESS dbproc );

where

dbproc
Is the DBPROCESS structure that is the handle for a particular workstation/ SQL Server process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.

Returns

A generic BYTE pointer to the user's private data space. This pointer must have been previously saved with the dbsetuserdata function.

Remarks

The functions dbgetuserdata and dbsetuserdata allow the application to associate user data with a particular DBPROCESS, without using global variables. One use for these functions is to handle deadlock. See the example under dbsetuserdata. That example reruns the transaction when the application's message handler detects deadlock.

This function is particularly useful when the application has more than one DBPROCESS.

See Also

dbsetuserdata