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: Sending and Executing Queries


DBSend

You can use the DBSend function to send a query or a portion of a query to a data server.

FUNCTION DBSend (sessID: LongInt; text: Ptr; len: Integer; 
                 asyncPB: DBAsyncParmBlkPtr): OSErr;
sessID
The session ID that was returned by the DBInit function.
text
A pointer to the query or query fragment that you want to send to the data server. The query or query fragment must be a character string.
len
The length of the character string. If the len parameter has a value of -1, then the character string is assumed to be NULL terminated (that is, the string ends with a NULL byte); otherwise, the len parameter specifies the number of bytes in the string.
asyncPB
A pointer to an asynchronous parameter block. If you do not want to call the function asynchronously, set this parameter to NIL.
DESCRIPTION
The DBSend function sends a query or a portion of a query to the data server. The data server appends this portion of the query to any portion you sent previously. Because the Data Access Manager does not modify the string you send in any way, it does not insert any delimiter between fragments of queries that you send to the data server. If you want a blank or a semicolon to be included between query fragments, or if you want to use return characters to divide the query into lines of text, you must include them in the character string that you send with this function.

The data server does not execute the query until you call the DBExec function.

SPECIAL CONSIDERATIONS
The DBSend 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 DBSend function are
Trap macroSelector
_DBSend$0706

RESULT CODES
noErr0No error
rcDBError-802Error trying to send text
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
For a description of the asynchronous parameter block, see page 12-56. See Listing 12-4 beginning on page 12-32 for an example of the use of the DBSend function in sending a query fragment. See page 12-79 for a description of the DBExec function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996