dbgetuserdata

DB Library for C

DB Library for C

dbgetuserdata

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

Syntax

LPVOID dbgetuserdata ( PDBPROCESS dbproc );

Arguments

dbproc

Is the DBPROCESS structure that is the handle for a particular workstation or Microsoft® SQL Server™ 2000 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. (For an example, see the example under dbsetuserdata. That example reruns the transaction when the application's message handler detects deadlock.)

You can call dbgetuserdata when dbdead returns TRUE.

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

See Also

dbsetuserdata