Your application can request asynchronous processing for the four functions that submit requests to a data source and retrieve data: SQLEXEC(В ), SQLMORERESULTS(В ), SQLTABLES(В ), and SQLCOLUMNS(В ). You enable asynchronous processing by setting the Asynchronous property of the connection with the SQLSETPROP(В ) function. When asynchronous communication is established for the connection, all four of these functions operate asynchronously.
To check the setting of the Asynchronous property
Use the SQLGETPROP( ) Function to view the Asynchronous property setting. In the following example,
nConnectionHandlerepresents the handle number for your active connection:
В Copy Code
To enable asynchronous processing
Use the SQLSETPROP( ) Function to specify the Asynchronous property:
В Copy Code
? SQLSETPROP(nConnectionHandle,'Asynchronous', .T.)
In Asynchronous mode, you must call each function repeatedly until it returns a value other than 0 (still executing). While the function is still executing, you can cancel processing of the function by pressing the ESC key if the SET ESCAPE property is set to true (.T.).
Until the function has finished processing, the application can use a connection handle only with the SQLCANCEL( ) Function or with the asynchronous functions вЂ” SQLEXEC(В ), SQLMORERESULTS(В ), SQLTABLES(В ), or SQLCOLUMNS(В ) вЂ” originally associated with the handle. You can't call any of the other three asynchronous functions or SQLDISCONNECT(В ) with the same connection handle until the function has finished.