FireDAC.Comp.Client.TFDCustomConnection.Open
Delphi
procedure Open(const AConnectionString: String); overload;
procedure Open(const AConnectionString: String;
const AUserName: String; const APassword: String); overload;
procedure Open(const AUserName: String; const APassword: String); overload;
C++
HIDESBASE void __fastcall Open(const System::UnicodeString AConnectionString)/* overload */;
HIDESBASE void __fastcall Open(const System::UnicodeString AConnectionString, const System::UnicodeString AUserName, const System::UnicodeString APassword)/* overload */;
HIDESBASE void __fastcall Open(const System::UnicodeString AUserName, const System::UnicodeString APassword)/* overload */;
inline void __fastcall Open(){ Data::Db::TCustomConnection::Open(); }
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomConnection |
Description
Opens the connection to the database.
Call the Open method to open the connection to a DBMS, using the specified connection string. The method is a shortcut to the filling of the Params property and setting Connected to True.
This method is overloaded:
- The first overloaded method opens a connection to the database, using a specified connection string.
- The second overloaded method opens a connection to the database, using the specified username and password.
- The third overloaded method opens a connection to the database, using the specified connection parameters, username, and password.
The AConnectionString
string value may be one of two forms:
- It is a semicolon-separated list (';') of the <name>=<value> connection definition parameter pairs. If the connection string contains the
User_Name
and/orPassword
parameters, and theAUserName
and/orAPassword
arguments are specified, then they will override the corresponding parameters in the connection string. - It is a connection definition name.
Example
//First overloaded method:
FDConnection1.Open('DriverID=Ora;Database=ORA_920_APP;User_Name=addemo;Password=a');
//Second overloaded method:
FDConnection1.Open('DriverID=Ora;Database=ORA_920_APP', 'addemo', 'a');
//Third overloaded method:
FDConnection1.Open('addemo', 'a');