GetRecordSet PowerScript function
Description
Returns the current ADO Recordset object.
Controls
ADOResultSet objects
Syntax
|
1 |
<span>adoresultset</span>.<span>GetRecordSet</span> ( <span>adorecordsetobject </span>) |
|
Argument |
Description |
|---|---|
|
adoresultset |
An ADOResultSet object that contains |
|
adorecordsetobject |
An OLEObject object into which the function |
Return Values
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.
|
1 |
resultset lrs_resultset<br>ADOresultset lrs_ADOresultset<br>OLEObject loo_ADOrecordset<br>// Generate a result set from an existing DataStore<br>ds_source.GenerateResultSet(lrs_resultset)<br> <br>// Create a new ADOResultSet object and populate it<br>// from the generated result set<br>lrs_ADOresultset = CREATE ADOResultSet<br>lrs_ADOresultset.<span>SetResultSet</span>(lrs_resultset)<br> <br>// Pass the data in the ADOResultSet object<br>// to an OLEObject you can use as an ADO Recordset<br>loo_ADOrecordset = CREATE OLEObject<br>lrs_ADOresultset.<span>GetRecordSet</span>(loo_ADOrecordset)<br>// Call native ADO Recordset methods on the OLEObject<br>loo_ADOrecordset.MoveFirst() |
See Also
-
GenerateResultSet method
for DataWindows in the DataWindow Reference or the online Help