DBGetSessionNum
The DBGetSessionNum function returns a session number when you specify the session ID.
FUNCTION DBGetSessionNum (sessID: LongInt; VAR sessNum: Integer;
asyncPB: DBAsyncParmBlkPtr): OSErr;
sessID
- The session ID that was returned by the
DBInit function.
sessNum
- Returns the session number of the session you specify with the
sessID parameter. The session number is unique for a particular database extension, but the same session number might be in use for different database extensions at the same time.
asyncPB
- A pointer to an asynchronous parameter block. If you do not want to call the function asynchronously, set this parameter to
NIL.
DESCRIPTION
You can use the DBGetSessionNum function to determine the session numbers for the sessions opened by your own application. You might want this information, for example, so you can distinguish your own sessions from those opened by other applications when you use the DBGetConnInfo function to get information about all open sessions.
SPECIAL CONSIDERATIONS
The DBGetSessionNum function may move or purge memory. You should not call this routine from within an interrupt, such as in a completion routine or a VBL task.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the DBGetSessionNum function are
| Trap macro | Selector |
| _DBGetSessionNum | $0605 |
RESULT CODES
| noErr | 0 | No error |
| rcDBBadSessID | -806 | Session ID is invalid |
| rcDBAsyncNotSupp | -809 | The database extension does not support asynchronous calls |
| rcDBPackNotInited | -813 | The InitDBPack function has not yet been called |
SEE ALSO
A description of the asynchronous parameter block structure begins on page 12-56. The DBInit function description begins on page 12-69. A description of the DBGetConnInfo function begins on page 12-72.