Options Property (Remote Data)

       

Returns or sets a value that specifies one or more operational characteristics of the RemoteData control.

Syntax

object.Options [= value ]

The Options property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A constant or Integer as described in Settings.

Settings

Use the following values to set the Options property for the RemoteData control:

Constant Value Description
rdAsyncEnable 32 Execute the query asynchronously.
rdExecDirect 64 Use the ODBC SQLExecDirect API function to execute query.

Remarks

This property corresponds to the options argument in the OpenResultset and Execute methods. If you change the Options property at run time, you must use the Refresh method for the change to have any effect.

Enable Asynchronous Operations

Asynchronous operations permit RemoteData objects to work in the background on operations like creating result sets or executing procedures while your foreground code continues to work.

Whenever you use the OpenResultset, Execute, Move or MoreResults methods with the rdAsyncEnable option, control returns immediately to your application — before the operation is completed by RDO. If required, RDO periodically checks the data source to see if the operation is complete. You can adjust the frequency of this polling by setting the AsyncCheckInterval property. To see if your operation has completed, check the StillExecuting property which remains True until RDO completes the operation. To cancel the operation, use the rdoResultset object's Cancel method. In addition, when queries are complete, RDO fires the QueryComplete event to indicate that the rdoResultset is ready to access.

Enable Use of SQLExecDirect

If you use the rdExecDirect option, RDO uses the SQLExecDirect ODBC API function to execute the query. In this case, no temporary stored procedure is created to execute the query. This option can save time if you don't expect to execute the query more than a few times in the course of your application. In addition, when working with queries that should not be run as stored procedures but executed directly, this option is mandatory. For example, in queries that create temporary tables for use by subsequent queries, you must use the rdExecDirect option.