RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TRDSConnection.GetRecordset Method

Retrieves a Recordset.

Pascal
function GetRecordset(const CommandText: WideString; ConnectionString: WideString = ''): _Recordset;
C++
__fastcall _Recordset GetRecordset(const BSTR CommandText, BSTR ConnectionString = '');

Call GetRecordset to retrieve a Recordset object from a business object. GetRecordset is called automatically by the TADODataSet associated with the RDS connection component. 

When using a business object, only the CommandText parameter should be passed a value. This is the Name property of the business object that returns the Recordset object. When GetRecordset is called by the TADODataSet component, the value used for the CommandText parameter is the value in the CommandText property of the ADO dataset component. 

When using a DataFactory, the CommandText parameter is a query command (SQL statement) to execute and the ConnectionString specifies the information needed to establish the connection. When GetRecordset is called by the ADO dataset component, the value used for the ConnectionString parameter is the value in the ConnectionString property of the ADO dataset component.

ADODataSet1.CommandText := 'SELECT * FROM Employee';
ADODataSet1.RecordSet := RDSConnection1.GetRecordset(ADODataSet1.CommandText, '');

 

ADODataSet1->CommandText := "SELECT * FROM Employee";
ADODataSet1->Recordset := RDSConnection1->GetRecordset(ADODataSet1.CommandText, "");

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!