From RAD Studio API Documentation
Jump to: navigation, search


procedure LoadParamsFromIniFile( FFileName: string = '');


void __fastcall LoadParamsFromIniFile(System::UnicodeString FFileName = System::UnicodeString());


Type Visibility Source Unit Parent
Data.SqlExpr TSQLConnection


Sets the DriverName and Params properties to the values associated with the ConnectionName property.

Call LoadParamsFromIniFile to ensure that the DriverName and Params properties accurately reflect the connection configuration for the ConnectionName property that is stored in the file specified by the AFileName parameter. If the AFileName parameter is omitted, LoadParamsFromIniFile uses the dbxconnections.ini file. Otherwise, it is a fully-qualified path name to a file that has the same format as the dbxconnections.ini file. Typically, this file is created by making a copy of the dbxconnections.ini file under a different name.

In most cases, it is unnecessary to load connection configurations at runtime because when you set ConnectionName at design time, the DriverName and Params properties are automatically set as well. However, LoadParamsFromIniFile lets you use a customized set of connection configurations at runtime that differ from those stored in the dbxconnections.ini file, or to temporarily override the DriverName or connection parameter values at design time and then reestablish the defaults at runtime.

Note: Do not set the LoadParamsOnConnect property to true if your application calls LoadParamsFromIniFile and specifies an alternate connections file. When LoadParamsOnConnect is true, it loads the connection configuration from the dbxconnections.ini file immediately before opening a connection, overriding any values loaded by this method.

See Also