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 Structures


The Asynchronous Parameter Block

Each Data Access Manager routine that can be called asynchronously (that is, that can return control to your application before it has completed execution) takes as a parameter a pointer to a parameter block known as the asynchronous parameter block. If you specify NIL for this parameter, the routine does not return control to your application until it has completed execution.

Note
The asynchronous parameter block is passed on to the database extension, which is responsible for implementing the asynchronous routine. If the database extension does not support asynchronous routines, the Data Access Manager returns the rcDBAsyncNotSupp result code and terminates execution of the routine.
The DBAsyncParamBlockRec data type defines the asynchronous parameter block.

TYPE DBAsyncParamBlockRec = 
   RECORD
      completionProc:   ProcPtr; {pointer to completion routine}
      result:           OSErr;   {result of call}
      userRef:          LongInt; {reserved for use by application}
      ddevRef:          LongInt; {reserved for use by database }
                                 { extension}
      reserved:         LongInt; {reserved for use by Data }
                                 { Access Manager}
   END;

   DBAsyncParmBlkPtr = ^DBAsyncParamBlockRec;
Field Description
completionProc
Points to a completion routine that the database extension calls when it has completed executing the asynchronous function. Before calling the completion routine, the Data Access Manager places a pointer to the asynchronous parameter block in the A0 register. If you do not want to use a completion routine, set this parameter to NIL.
result
Returns the result code for the called routine. The database extension sets this field to 1 while the routine is executing and places the result code in it when the routine completes. Your application can poll this field to determine when an asynchronous routine has completed execution.
userRef
Reserved for the application's use. Because the Data Access Manager passes a pointer to the parameter block to the completion routine, you can use this field to pass information to the completion routine.
ddevRef
Reserved for use by the database extension.
reserved
Reserved for use by the Data Access Manager.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996