Resultset Property

       

Returns or sets an rdoResultset object defined by a RemoteData control or as returned by the OpenResultset method.

Syntax

Set object.Resultset [= value]

The Resultset property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value An object expression that evaluates to an rdoResultset object as described in Settings.

Settings

The setting for value is an rdoResultset object.

Remarks

The RemoteData control is automatically initialized when your application starts. If the SQL property is valid, or if you set the SQL property at run time and use the Refresh method, the RemoteData control attempts to create a new rdoResultset object. This rdoResultset is accessible through the RemoteData control's Resultset property.

If you create an rdoResultset object using either RDO code or another RemoteData control, you can set the Resultset property of the RemoteData control to this new rdoResultset. Any existing rdoResultset in the RemoteData control, and the rdoConnection object associated with it, are released when a new rdoResultset is assigned to the Resultset property.

You can also create an rdoResultset object using the OpenResultset method and setting the Resultset property to the resulting rdoResultset object. However, the bound controls using the RemoteData control must correctly specify the columns of the new rdoResultset. To do so, make sure the DataField properties of the bound controls connected to the RemoteData control are set to match the new rdoResultset object's column names.

Type of Result Set

You can also determine the type of rdoResultset cursor by examining or setting the RemoteData control's ResultsetType property. If you don't request a specific type when using the RemoteData control, a keyset-type rdoResultset is created. You can determine the type of rdoResultset at run time by examining the rdoResultset object's Type property or the RemoteData control's ResultsetType property.

The RemoteData control can create either keyset- or static-type rdoResultset objects when accessing SQL Server 6. However, if the ODBC driver does not support keyset cursors, they cannot be created — all drivers support static cursors. A trappable error is triggered if you set the RemoteData control's Resultset property to an unsupported type of rdoResultset.

Note   When the Resultset property is set, the RemoteData control doesn't close the current rdoResultset or rdoConnection, but it does release it. If there are no other users, the rdoConnection is closed automatically. You may want to consider closing the rdoResultset and rdoConnection associated with the RemoteData control before setting the Resultset property.

All rdoResultset objects created by the RemoteData control are built in rdoEnvironments(0). If you need to use the RemoteData control to manipulate a database in another rdoEnvironment, use the technique demonstrated in the example to open the rdoConnection in the desired rdoEnvironment, create a new rdoResultset, and set the RemoteData control's Resultset property to this new rdoResultset.