Reputation: 41
I have a Delphi 10 application that has a number of forms in it. Each Form uses a TFDConnection that is created on login with the name "Connection1". Currently the TFDManager is defined in one form and the TFDConnection is defined in another form. Question is how do I link these two together so that TFDConnection inherits some of the setting from TFDManager. Are all TFDConnections in the application automatically linked to TFDManager or is there a setting in TFDConnection that needs to be enabled to link it to TFDManager?
Upvotes: 1
Views: 775
Reputation: 12302
You can link two components at design time (Object inspector) from different forms only after you added the other form in the uses clause. Once you do that, in the object inspector the drop down list for a property shows the values from the other form as well.
You can also link them at run time: Assign the property of one to the value of the other.
FDQuery1.Connection := Form1.FDConnection1;
Note that this makes the two forms dependent and you could be in trouble if you don't correctly manage the life time of both forms.
Don't forget to read the documentation!
Upvotes: 1