Path Variables (FireDAC)
Go Up to Multi-Device Development (FireDAC)
FireDAC allows you to use substitution variables in the paths, including:
- The Database connection parameter, specifying a local database connection path
- The TFDScript.SQLScriptFileName property
- The TADMoniFlatFileClientLink.FileName property
- The TFDManager.ConnectionDefFileName property
- The TFDManager.DriverDefFileName property
- The FireDAC.Stan.Util.FDExpandStr property that expands aliases to real path
- The Database and BackupFiles properties of the InterBase and Firebird service components
- The Database and DestDatabase properties of the MS Access service components
A string value may contain substitution variables with the format $(name). There are several predefined variable names:
- DOC -- the documents folder path
- TEMP -- the temporary files folder path
- RUN -- the application executable path
- RAND -- the random integer number
- NEXT -- the next integer number in the specified path
- APP -- the application executable path for iOS, Windows, macOS, and Linux. On other platforms, corresponds to the TPath.GetHomePath.
- CFG -- For iOS and Android, corresponds to TPath.GetHomePath. On other platforms, it is the same as APP.
- SYSCFG -- the Windows System folder on Windows. For iOS, Android, and other platforms (maxOS and Linux), it works as the TPath.GetHomePath.
Additionally, a variable can be the name of an environment variable.
All variable values are without a terminated slash. In a string value, you can use both forward and back slashes. FireDAC replaces the slashes with the appropriate value for a platform.
Example
A path to an SQLite DB on an iOS device:
$(DOC)/test.sdb
A path to a temporary DB:
$(TEMP)\data.sdb
A path for an incremental DB backup file:
/tmp/addemo$(NEXT).bck
A path for a trace file:
c:\temp\trace$(NEXT).txt