Important: The information in this document is obsolete and should not be used for new development.
DBGetSessionNum
TheDBGetSessionNumfunction 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
DBInitfunction.sessNum- Returns the session number of the session you specify with the
sessIDparameter. 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 theDBGetSessionNumfunction 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 theDBGetConnInfofunction to get information about all open sessions.SPECIAL CONSIDERATIONS
TheDBGetSessionNumfunction 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 theDBGetSessionNumfunction 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 InitDBPackfunction has not yet been calledSEE ALSO
A description of the asynchronous parameter block structure begins on page 12-56. TheDBInitfunction description begins on page 12-69. A description of theDBGetConnInfofunction begins on page 12-72.