Paul
Paul

Reputation: 26690

Execute FireDAC connection editor at run time

I would like to execute FireDAC connection editor at run time, but haven't found which class is the Component Editor for TFDConnection.

For example, it is easy to find out which class is the Component Editor for TADOConnection.

Upvotes: 1

Views: 1900

Answers (2)

Ilyes
Ilyes

Reputation: 14928

You can excute FireDac connection editor by calling Execute method of TfrmFDGUIxFormsConnEdit which you can find it in FireDAC.VCLUI.ConnEdit unit.

Here is an example how to do it:

Uses ... FireDAC.VCLUI.ConnEdit;

..

var FDConnEditor : TfrmFDGUIxFormsConnEdit;
begin
    FDConnEditor := TfrmFDGUIxFormsConnEdit.Create(Self);
    try
      FDConnEditor.Execute(FDConnection1,'Caption',nil);
    finally
      FDConnEditor.Free;
    end;
end;

Now you must use the Driver ID and it's parameters to work with DBMS, so you need to use drivers you need which you can find them in FireDAC.Phys unit, for example a TFDPhysMSSQLDriverLink in FireDAC.Phys.MSSQL.pas(MS SQL Driver), or simply drop them from FireDAC Links tab in the component platte.

Upvotes: 4

Uwe Raabe
Uwe Raabe

Reputation: 47819

The editor form for FireDAC connections is TfrmFDGUIxFormsConnEdit located in unit FireDAC.VCLUI.ConnEdit. It provides a class method called Execute you can call with the connection as the first parameter.

Upvotes: 4

Related Questions