DBGetNewQuery
You can use the DBGetNewQuery function to create a query record.
FUNCTION DBGetNewQuery (queryID: Integer;
VAR query: QueryHandle): OSErr;
queryID
- The resource ID of a
'qrsc' resource.
query
- Returns a handle to the query record.
DESCRIPTION
The DBGetNewQuery function creates a query record from the specified 'qrsc' resource. The resource file that contains the 'qrsc' resource must remain open until after the DBStartQuery function has completed execution. If you do not already know the resource ID of the 'qrsc' resource (for example, if you call the StandardGetFile procedure to let the user select the query document), you can use Resource Manager routines to determine the resource ID.
SPECIAL CONSIDERATIONS
The DBGetNewQuery 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 DBGetNewQuery function are
| Trap macro | Selector |
_DBGetNewQuery | $030F |
RESULT CODES
| noErr | 0 | No error |
| rcDBPackNotInited | -813 | The InitDBPack function has not yet been called |
SEE ALSO
See Listing 12-1 beginning on page 12-18 for an example of the use of the DBGetNewQuery function. For a description of the query record, see page 12-57. For a description of the 'qrsc' resource, see "The Query Resource" beginning on page 12-91. The StandardGetFile procedure is described in the chapter "Standard File Package" in Inside Macintosh: Files, and Resource Manager routines are described in the chapter "Resource Manager" in Inside Macintosh: More Macintosh Toolbox.