How to: Use SQL Pass-Through Asynchronously
|Visual FoxPro 9.0 SP2|
|How to: Use SQL Pass-Through Asynchronously|
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 theto view the Asynchronous property setting. In the following example,
nConnectionHandlerepresents the handle number for your active connection:
To enable asynchronous processing
Use theto specify the Asynchronous property:
? 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 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.or with the asynchronous functions —
Comment or report problem with topic