user
QueryRecord structure
#include
typedef struct QueryRecord { Size Offset Description
short version; 2 0 version
short id; 2 2 id of 'qrsc' this came from
Handle queryProc; 4 4 handle to query def proc
Str63 ddevName; 64 8 ddev name
Str255 host; 256 72 host
Str255 user; 256 328 user
Str255 password; 256 584 password
Str255 connStr; 256 840 connection string
short currQuery; 2 1096 current query
short numQueries; 2 1098 number of queries in queryList
QueryListHandle queryList; 4 1100 handle to list of queries
short numRes; 2 1104 number of resources in resList
ResListHandle resList; 4 1106 handle to list of other resources
Handle dataHandle; 4 1110 data used by query def proc
long refCon; 4 1114 query's reference value
} QueryRecord; 1118
typedef QueryRecord *QueryPtr;
typedef QueryRecord QueryHandle;
Field descriptions
version The version number of the QueryRecord format. For
the Data Access Manager released with system
software version 7.0, the version number is 0.
id The resource ID of the 'qrsc' resource from which the
Data Access Manager created this QueryRecord.
queryProc A handle to the query definition function that the
DBStartQuery function calls. This handle is NIL if
there is no query definition function-that is, if the
DBStartQuery function should send the query
specified by this QueryRecord to the data server
without modifications.
ddevName The database extension name used as a parameter to the
DBInit function.
host The name of the host computer system used as a
parameter to theDBInit function.
user The name of the user, used as a parameter to the
DBInit function.
password The user's password, used as a parameter to the
DBInit function.
connStr The connection string used as a parameter to the
DBInit function.
currQuery An index value from 1 through numQueries, indicating
which element in the array of query handles re presents
the current query. The current query is the one
actually sent to the data server. If the query document
contains more than one 'wstr' resource, the query
definition function can prompt the user to select a new
current query and modify this field in the query record
appropriately.
numQueries The number of queries referred to by the queryList
field.
queryList A handle to an array of handles. Each handle in this
array refers to a query. Each query is created from a
'wstr' resource in the query document and is stored in
memory as a 2-byte length field followed by ASCII text.
(The length does not include the 2 bytes of the length
field.) The query definition function can create a new
query. To add a new handle to the array of handles, use
the
Memory Manager's SetHandleSize function to
increase the size of the array. Don't forget to change the
value of the numQueries field as well.
numRes The number of resources referred to by the resList
field.
resList A handle to an array of records of type ResListElem.
Each record in the array contains the type and ID of a
resource that is needed by the query definition function.
dataHandle A handle to memory for use by the query definition
function. When the Data Access Manager first
creates the query record, this field is NIL. The query
definition function can allocate memory and place a
handle to it in this field. The query definition function
should dispose of any memory it allocates before it
returns control to the
Data Access Manager.
refCon The query record's reference value. The application
can use this field for any purpose.