Data.Win.ADODB.TRDSConnection.GetRecordset

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetRecordset(const CommandText: WideString;
ConnectionString: WideString = ''): _Recordset;

C++

Winapi::Adoint::_di__Recordset __fastcall GetRecordset(const System::WideString CommandText, System::WideString ConnectionString = System::WideString());

Properties

Type Visibility Source Unit Parent
function public
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TRDSConnection

Description

Retrieves a Recordset.

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, "");