Important: The information in this document is obsolete and should not be used for new development.
DBSendItem
You can use theDBSendItemfunction to send to the data server the data that you wish to include in a query.
FUNCTION DBSendItem (sessID: LongInt; dataType: DBType; len: Integer; places: Integer; flags: Integer; buffer: Ptr; asyncPB: DBAsyncParmBlkPtr): OSErr;
sessID- The session ID that was returned by the
DBInitfunction.dataType- The data type for the data item that you are sending to the data server.
len- The length of the data item that you are sending to the data server. The database extension and data server ignore the
lenparameter if the data type has an implied length.places- The number of decimal places for the data item that you are sending to the data server. The database extension and data server ignore the
placesparameter for all values of thedataTypeparameter excepttypeDecimalandtypeMoney.flags- Set the
flagsparameter to 0. There are no flags currently defined for theDBSendItemfunction.buffer- A pointer to the memory location of the data item that you want to send. When you use the
DBSendItemfunction to send an item of data to a data server, the database extension and data server format the data according to the data type, length, and decimal places you specify, convert it to a character string, and append the data to the query.asyncPB- A pointer to an asynchronous parameter block. If you do not want to call the function asynchronously, set this parameter to
NIL.DESCRIPTION
TheDBSendItemfunction sends a single data item to the data server. The database extension or the data server (depending on how the system is implemented) converts the data item to a character string and appends it to the query, just as theDBSendfunction appends a query program fragment to the query. The query is not executed until you call theDBExecfunction.SPECIAL CONSIDERATIONS
TheDBSendItemfunction 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 theDBSendItemfunction are
Trap macro Selector _DBSendItem $0B07 RESULT CODES
noErr 0 No error rcDBError -802 Error trying to send item 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
For a discussion of data types, see "Getting Query Results" beginning on page 12-37. 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 theDBSendItemfunction in sending a query fragment. See page 12-77 for a description of theDBSendfunction. TheDBExecfunction is described next.