SQLSynchronize

Syntax

SQLSynchronize(Flag)

Remarks

Specifies whether to allow ODBC functions to be called asynchronously. Several of the functions in the ODBC API can be called asynchronously. The ODBC extensions for Microsoft Word take advantage of this functionality. Not all ODBC drivers can handle asynchronous calls, but the ODBC API was designed so that the calling convention is the same for all drivers.

For complete information on asynchronous processing, see "Requesting Asynchronous Processing" in Chapter 6, "Executing SQL Statements," in the Microsoft ODBC Programmer's Reference in the Microsoft ODBC Software Development Kit version 2.0.

Argument

Explanation

Flag

Specifies whether to enable or disable asynchronous processing:

0 (zero) Enables asynchronous processing; subsequently, SQL functions may return –2 (SQL_StillExecuting) if activity on the connection is not complete.

1 Disables asynchronous processing.


If SQLSynchronize is unsuccessful, the function returns a negative error value.

Example

The following example demonstrates the calling convention for asynchronous ODBC functions.


err = SQLSynchronize(0)
status = SQLExecQuery(connection, query_string$)
While SQLRetrieveRows(connection) = -2
    'Series of statements to perform other processing
Wend

The ODBC functions used in the WBODBC.WLL can be called in this manner after asynchronous processing is enabled.