FireDAC.Comp.Client.TFDTable.Open

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDTable

Delphi

procedure Open(const ATableName: String); overload;

C++

HIDESBASE void __fastcall Open(const System::UnicodeString ATableName)/* overload */;
inline void __fastcall  Open(const System::UnicodeString ASQL, const System::Variant *AParams, const System::NativeInt AParams_High){ TFDRdbmsDataSet::Open(ASQL, AParams, AParams_High); }
inline void __fastcall  Open(const System::UnicodeString ASQL, const System::Variant *AParams, const System::NativeInt AParams_High, const Data::Db::TFieldType *ATypes, const System::NativeInt ATypes_High){ TFDRdbmsDataSet::Open(ASQL, AParams, AParams_High, ATypes, ATypes_High); }
inline void __fastcall  Open(){ Data::Db::TDataSet::Open(); }

Description

Opens the specified database table.

Call Open to open the database table specified in ATable. If ATable is empty, then it is assigned to the TableName property. The method closes the dataset if it was active, then it assigns ATable to the TableName, and sets the Active property to True. When Active is True, the dataset is populated with data from a database. 

If the DBMS returns an error, then FireDAC raises an exception, which can be analyzed in the OnError event.

Example

FDTable1.Open('customers');
FDTable2.Open('[Order Details]');

See Also