Home | Sign in | English EN

  • Multiple directory substitutions
  • Substituting directories
  • Miscellaneous
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
HSubstDir (Function)
In french: HSubstRep
OLE DBHFSQLAvailable only with these kinds of connection
Associates the data directory specified in the analysis with a directory found on disk. Once HSubstDir has been run, all the data files associated with the directory specified in the analysis will be handled in the indicated directory.
Caution: The data files must be closed beforehand (HClose).
To modify the path of a single data file, use HChangeDir.
Remark: In Client/Server mode, use HChangeDir.
Remark : From version 19, HFSQL is the new name of HyperFileSQL.
Reports and QueriesHFSQLHyper File 5.5OLE DB
// Change the directory for the files defined in
// a specific directory in the analysis
HSubstDir("C:\File", "D:\File")
// Open/Create the files in the new directory
Reports and QueriesHFSQL
IF HSubstDir(".","C:\ACCOUNTING\YEAR2012") = True THEN
Info("You are going to work on the files found in the directory: C:\ACCOUNTING\YEAR2012")
<Result> = HSubstDir(<Directory of files specified in analysis> , <Physical directory of files on disk>)
<Result>: Boolean
This parameter is always equal to True. If an error occurs, the next function for accessing the data file will return False. For example, if the specified physical directory does not exist, a directory error will occur during the first access to the data file.
<Directory of files specified in analysis>: Character string
Name of the directory specified during the description of the data file.
<Physical directory of files on disk>: Character string
New name of the directory (up to 260 characters). A UNC path can be used.
HSubstDir is ignored if the specified directory contains data files in a format other than HFSQL.

Multiple directory substitutions

HSubstDir can be called several times with different parameters. When the physical directory is redefined several times for the same logical directory (described in the analysis), the last specified physical directory replaces all the other ones.

Substituting directories

HChangeDir is used to associate a directory with a data file. To replace a directory with another one, use HSubstDir.
Caution: the change of directory performed by HSubstDir applies to the directory defined by HChangeDir. For example:
HSubstDir("C:\Statistics\January", "C:\New\JanStats")
HChangeDir(Stat, "C:\Statistics\January")
HCréation(Stat) //File created in C:\New\JanStats


  • If the management of ".REP" is enabled (HSetREP), the modification of the path is saved in the ".REP" file (see management of .REP files).
  • The new path is stored when the data file is closed.
  • This function cannot be used during a remote access. For more details, see RPC on HFSQL (Remote access).
  • The number of substitutions is unlimited.
Business / UI classification: Business Logic
Component: wd270hf.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment