在运行时执行FireDAC连接编辑器 [英] Execute FireDAC connection editor at run time
问题描述
我想在运行时执行FireDAC连接编辑器,但没有找到哪个类是 TFDConnection
的组件编辑器.
I would like to execute FireDAC connection editor at run time, but haven't found which class is the Component Editor for TFDConnection
.
例如,很容易找出哪个类是TADOConnection的组件编辑器.
For example, it is easy to find out which class is the Component Editor for TADOConnection.
推荐答案
您可以通过调用 TfrmFDGUIxFormsConnEdit
的 Execute
方法来执行 FireDac
连接编辑器您可以在 FireDAC.VCLUI.ConnEdit
单元中找到它.
You can excute FireDac
connection editor by calling Execute
method of TfrmFDGUIxFormsConnEdit
which you can find it in FireDAC.VCLUI.ConnEdit
unit.
下面是一个示例:
Uses ... FireDAC.VCLUI.ConnEdit;
..
var FDConnEditor : TfrmFDGUIxFormsConnEdit;
begin
FDConnEditor := TfrmFDGUIxFormsConnEdit.Create(Self);
try
FDConnEditor.Execute(FDConnection1,'Caption',nil);
finally
FDConnEditor.Free;
end;
end;
现在,您必须使用 Driver ID
及其参数才能与DBMS一起使用,因此您需要使用所需的驱动程序,可以在 FireDAC.Phys
单元中找到它们.,例如 FireDAC.Phys.MSSQL.pas
(MS SQL驱动程序)中的 TFDPhysMSSQLDriverLink
,或者只是将它们从组件平台.
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.
这篇关于在运行时执行FireDAC连接编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!