Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Use conditions
  • Multiple changes of name
  • Changing the drive or the directory
  • <Source>.ChangeName function: Use with the Native Connectors and/or the OLE DB provider
  • Miscellaneous
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
<Source>.ChangeName (Function)
In french: <Source>.ChangeNom
ODBCNot available with this kind of connection
Modifies the physical name of a data file.
Reminder: By default, the physical file is created with the name that was given to it in the analysis.
// Create the statistical file for January
<Result> = <Source>.ChangeName(<Physical name>)
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error.
<Source>: Type corresponding to the specified source
Name of the data file (defined in the analysis). This name is used by all the functions for handling the HFSQL data files.
<Physical name>: Character string
New physical name of the data file.
  • If this parameter is an empty string (""), the physical name used will correspond to the physical name defined in the analysis.
  • This parameter must contain no drive name and no directory name.
  • This name will be stored when closing the data file.
  • The PhysicalName property is used to find out the physical name given to the data file by <Source>.ChangeName.
OLE DBNative Connectors (Native Accesses) Depending to the database used, the physical name of the data file can be prefixed by the name of the database, the name of the user, or the name of the schema. In this case:
  • the full physical name is specified in the data file description in the data model editor ("Name of the table in the external database").
  • <Source>.ChangeName can also be used to change the physical name of the data file. See Use with the Native Connectors and/or the OLE DB provider.

Use conditions

  • The data file must be closed in order for this modification to be taken into account (use <Source>.Close if necessary), otherwise the modification will be taken into account during the next opening.
  • Native Connectors (Native Accesses) XML: <Source>.ChangeName changes the name of the XML TAG associated with the data file described in the analysis (does not change the physical name). To change the name of the file, you must use a connection (HDescribeConnection by specifying the name of the XML file as data source) and associate this connection with the file via <Source>.ChangeConnection.

Multiple changes of name

<Source>.ChangeName can be called several times with different parameters. When the physical name is redefined several times for the same logical name, the last physical name that was given replaces all the other ones.

Changing the drive or the directory

<Source>.ChangeName can only be used to change the name of the physical file. To modify its location, use <Source>.ChangeDir and HSubstDir.
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxOLE DBNative Connectors (Native Accesses)

<Source>.ChangeName function: Use with the Native Connectors and/or the OLE DB provider

By default, the logical name passed to <Source>.ChangeName is considered as the only name in the table. It is encapsulated by using the encapsulation characters corresponding to the database or specified by the OLE DB provider before being sent to the database (this is used to manage the table names containing special characters).
To specify a file name composed of <Username>.<Table name> (or depending on the database, <Schema name>.<Table name>) in <Source>.ChangeName, these names must be already formatted (using encapsulation characters corresponding to the database, or specified by the OLE DB provider).
Example for SQLServer:
The encapsulation characters are " ".
To rename CUSTOMER as DBO.CUSTOMER using <Source>.ChangeName, you must pass "DBO"."CUSTOMER".
Therefore, the following code must be used:


  • If the management of ".REP" is enabled (HSetREP), the modification of the path is saved in the ".REP" file (see management of .REP files).
  • <Source>.ChangeName is equivalent to HSubstName, available in WINDEV 5.5/WEBDEV 1.5.
Component: wd300hf.dll
Minimum version required
  • Version 25
This page is also available for…
Click [Add] to post a comment

Last update: 07/06/2023

Send a report | Local help