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');
try
xIniFile.ReadSectionValues('connection', FDConnection.Params);
finally
xIniFile.Free;
end;
A Typical Configuration File
Typically, the config.ini
file contains the following lines:
[connection]
DriverID=FB
Protocol=TCPIP
Server=localhost/3051
Database=examples
OSAuthent=No
RoleName=
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 |