3.4.1. Connection Parameters in a Configuration File
Since the connection parameters, except for the username and password and possibly the role, are usually common to all instances the application, we will read them from the configuration file:
xIniFile := TIniFile.Create(xAppPath + 'config.ini');tryxIniFile.ReadSectionValues('connection', FDConnection.Params);finallyxIniFile.Free;end;
A Typical Configuration File
Typically, the config.ini file contains the following lines:
[connection]DriverID=FBProtocol=TCPIPServer=localhost/3051Database=examplesOSAuthent=NoRoleName=CharacterSet=UTF8
You can get the contents of the connection section by copying the contents of the Params property of the TFDConnection component after the wizard finishes its work.
Actually, the common settings are usually located in Note that if your application is installed into the |
