GetRecordSet

Description

Returns the current ADO Recordset object.

Applies to

ADOResultSet objects

Syntax

adoresultset.GetRecordSet ( adorecordsetobject )

Argument

Description

adoresultset

An ADOResultSet object that contains an ADO Recordset.

adorecordsetobject

An OLEObject object into which the function places the current ADO Recordset. This argument is passed by reference.


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs.

Usage

Use the GetRecordSet function to return an ADO Recordset as an OLEObject object that can be used in PowerBuilder as a native ADO Recordset. The ADOResultSet object that contains the ADO Recordset must first have been populated using the SetRecordSet or SetResultSet function.

Examples

This example generates a result set in a ResultSet object from an existing DataStore object. The ResultSet object is used to populate a new ADOResultSet object. The GetRecordSet function on the ADOResultSet object is used to return an ADO Recordset as an OLEObject that can be used with ADO Recordset methods.

resultset lrs_resultset
ADOresultset lrs_ADOresultset
OLEObject loo_ADOrecordset
// Generate a result set from an existing DataStore
ds_source.GenerateResultSet(lrs_resultset)

// Create a new ADOResultSet object and populate it
// from the generated result set
lrs_ADOresultset = CREATE ADOResultSet
lrs_ADOresultset.SetResultSet(lrs_resultset)

// Pass the data in the ADOResultSet object
// to an OLEObject you can use as an ADO Recordset
loo_ADOrecordset = CREATE OLEObject
lrs_ADOresultset.GetRecordSet(loo_ADOrecordset)
// Call native ADO Recordset methods on the OLEObject
loo_ADOrecordset.MoveFirst()

See also

GenerateResultSet method for DataWindows in the section called “GenerateResultSet” in DataWindow Reference.

SetRecordSet

SetResultSet