Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 12 - Data Access Manager / Data Access Manager Reference
Data Access Manager Routines / Low-Level Interface: Controlling the Session


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 macroSelector
_DBGetSessionNum$0605

RESULT CODES
noErr0No error
rcDBBadSessID-806Session ID is invalid
rcDBAsyncNotSupp-809The database extension does not support asynchronous calls
rcDBPackNotInited-813The 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996