- Multiple changes of directory
- Changing the name of data file
- Substituting directories
- Various
HChangeDir (Function) In french: HChangeRep
Not available with this kind of connection
- Modifies the access path to a data file (which means the directory where the data file will be used). If the data file is opened when using HChangeDir, the data file is automatically closed.
Reminder: By default, the physical file corresponding to the data file described in the analysis is handled in the directory specified in the analysis. - Changes the name of database associated with a table. In this case, the database name specified in the connection properties of table (in the data model editor) is ignored.
To modify the connection parameters of a data file not in HFSQL format, we recommend that you use HDescribeConnection and HChangeConnection.
Versions 17 and later New in version 17 Versions 18 and later New in version 18 Versions 21 and later New in version 21 Remark: From version 19, HFSQL is the new name of HyperFileSQL. Syntax
With HFSQL data files Hide the details
<Result> = HChangeDir(<Data file> , <New path of the data file>)
<Result>: Boolean - True if the operation was performed,
- False if a problem occurred. HError is used to identify the error.
<Data file>: Character string (with or without quotes) Logical name of HFSQL data file (defined in the analysis). If this parameter is equal to "*", the change of directory will be applied to all known data files (described in the analysis). This parameter can also correspond to the name of a group of files (or custom-folder) defined in the analysis (not available in Android and Android Widget). <New path of the data file>: Character string (with quotes) New path for access to the data file (260 characters maximum). This path can contain the name of drive and directories, or it can be a relative path. If the path is a relative path, the "." (or "?") character is used to specify the current directory and the ".." character is used to specify the parent directory. If this parameter corresponds to an empty string (""), the data file will be handled in the directory specified in the analysis.
Versions 17 and later New in version 17 Remarks Multiple changes of directory HChangeDir can be called several times with different parameters. When the path is redefined several times for the same data file, the last specified path replaces all the other ones. Changing the name of data file The function HChangeDir only allows you to change the access path to the physical data file. To change the physical name of data file, use the HChangeName function. Substituting directories HChangeDir is used to associate a directory with a data file. To substitute a directory for another one, use HSubstDir. Caution: The substitution 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") HCreation(Stat) // File created in C:\New\JanStats
Various - If the management of ".REP" is enabled (HSetREP), the modification of the path is saved in the ".REP" file (see management of .REP).
- Closing the data file stores the new path but does not store a possible password specified when opening the data file.
- HChangeDir is equivalent to HAssign available in the earlier versions.
- This function can be used when establishing a connection with a HFSQL server.  Caution: The order in which the functions for connecting to a HFSQL Client/Server database are called is important. See Optimizing the connection times to the HFSQL Client/Server databases for more details.
HChangeDir can be used with the Native XML Access.
This page is also available for…
|
|
|