DBStartQuery
long * sessID ; specifies a session ID
QueryHandle query ; a handle to the query record.
ProcPtr statusProc ; a pointer to a status routine DBAsyncParmBlkPtr asyncPB ; a pointer to an asynchronous parameter block.
specified:
1. It calls the query definition function (if any) pointed to by the
the query, usually by asking the user for input. The query definition function
can display a dialog box that gives the user the option of canceling the query; if
the user does cancel the query, the DBStartQuery function returns the userCanceledErr result code.
2. If you specify a nonzero value for the statusProc parameter, the
DBStartQuery function calls your status routine with the kDBUpdateWind constant in the message parameter so that your application can update its
windows.
3. If you specify a nonzero value for the statusProc parameter, the
DBStartQuery function calls your status routine with the kDBAboutToInit constant in the message parameter so that your application can display a dialog
box informing the user that a session is about to be initiated with a data
server, and giving the user the option of canceling execution of the function.
4. If the sessID parameter is 0, the DBStartQuery function calls the DBInit function to initiate a session, and returns a session ID. 5. If you specify a nonzero value for the statusProc parameter and the
function calls your status routine with the kDBInitComplete constant in the
message parameter and the result of the DBInit function in the function result. query to the data server.
7. If you specify a nonzero value for the statusProc parameter, the
DBStartQuery function calls your status routine with the kDBSendComplete constant in the message parameter and the result of the DBSend function in the result parameter.
the query.
9. If you specify a nonzero value for the statusProc parameter, the
DBStartQuery function calls your status routine with the kDBExecComplete constant in the message parameter and the result of the DBExec function in the result parameter.
10. If you specify a nonzero value for the statusProc parameter, the
kDBStartQueryComplete constant in the message parameter and the result of
sessID specifies a session ID if your application or another application has
already initiated a session with the data server. If you specify NIL for
this parameter, then the DBStartQuery function initiates a session and returns the session ID in the sessID parameter.
statusProc specifies a pointer to a status routine that your application can use
to update its windows after the query definition function has
completed execution. (The DBStartQuery function does not attempt to update your application's windows.) The DBStartQuery function also calls your status routine before it initiates a session with a data
server, after it calls the DBInit function, after it calls the DBSend function, and after it calls the DBExec function. Status routines are discussed in the section,
asyncPB a pointer to an asynchronous parameter block. The DBStartQuery asynchronously. As soon as the DBInit function has started execution, it returns control to your application. Your application
these asynchronous routines to run, and it must check the result
field of the asynchronous parameter block to determine when each
routine has completed execution.
noErr (0) No error
userCanceledErr (-128) User canceled the query
rcDBError (-802) Error initiating session, sending text, or executing
query
rcDBBadSessID (-806) Session ID is invalid
rcDBBadDDev (-808) Couldn't find the specified database extension, or error
occurred in opening database extension
rcDBAsyncNotSupp (-809) The database extension does not support asynchronous
calls
rcDBPackNotInited (-813) The InitDBPack function has not yet been called