ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
  • Operating mode of HCopyFile
  • Use conditions
  • Names of data files and directories on the server
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
HCopyFile (Function)
In french: HCopieFichier
HFSQL Client/ServerAvailable only with this kind of connection
Copies an HFSQL data file (.fic, .ndx, .ftx, .sdx and .mmo files, if any):
  • from the HFSQL server to the server (to perform a backup for example).
  • from the HFSQL server to the client (to perform a local backup for example).
  • from the client to the HFSQL server (to update the data files for example).
  • from an HFSQL server to another HFSQL server.
// Copie des fichiers de données du serveur vers le serveur
// avec renommage et changement de répertoire
HCopyFile(MaConnexion, ".\sauvegarde\fichierclient_sov.fic", MaConnexion, ".\fichierclient.fic")
// Copie des fichiers de données du poste serveur vers le poste client
HCopyFile("", "C:\Données\Client.fic", MaConnexion, "client.fic")
// Copie des fichiers de données du poste client vers le poste serveur
HCopyFile(MaConnexion, "client.fic", "", "C:\Données\Client.fic")
// Copie le(les) fichiers de données d'un serveur vers un autre serveur
HCopyFile("CNX", "client.fic", "CNX2", "rep\client.fic", hNoIndex, JAUGE_MaJauge)
// Copie le fichier de données CLIENT d'un client sur lui-même (sauvegarde)
sMonRepertoireDestination is string = CompleteDir(fExeDir()) + "RepertoireTest\"
IF NOT fDirectoryExist(sMonRepertoireDestination) THEN fMakeDir(sMonRepertoireDestination)
HCopyFile("", sMonRepertoireDestination + "CLIENT.FIC", "", ...
		CompleteDir(fExeDir()) + "CLIENT.FIC", hCopyIndex)
Syntax
<Result> = HCopyFile(<Destination connection> , <Destination data file> , <Source connection> , <Source data file> [, <Copy mode> [, <Progress Bar control> [, <Password>]]])
<Result>: Boolean
  • True if the data file was copied,
  • False if an error occurs. HError is used to identify the error.
<Destination connection>: Character string or Connection variable
Connection to which the data file must be copied. This connection corresponds to:
  • the name of the connection defined in the data model editor or with HDescribeConnection or HOpenConnection.
  • the name of a variable of type Connection.
  • either to the DNS of an HFSQL Cluster or to the node of an HFSQL Cluster (in the case of a copy to an HFSQL Cluster).
If this parameter corresponds to an empty string, the destination will be the local computer.
<Destination data file>: Character string
Name and path of destination data file. The path and this data file are automatically created if they do not exist on the server.
If the destination data file is found on the server, the path is relative to the database.
Warning: the data file extension '.fic' must be specified.
<Source connection>: Character string or Connection variable
Connection from which the data file must be copied. This connection corresponds to:
<Source data file>: Character string
Name and path of the source data file (to copy). If the source data file is found on the server, the path is relative to the database.
Caution:
  • the data file extension '.fic' must be specified.
  • the '.mmo' file, if any, will be automatically copied.
<Copy mode>: Optional Integer constant
Copy mode used:
hCopyIfNotFoundCopies the data file only if it does not exist at the specified location on the destination computer.
hCopyIndexData file indexes are copied (NDX, SDX and FTX files, if any).
hCreateIndexData file indexes are not copied (NDX, SDX and FTX files, if any). They are automatically recreated on the destination via a reindex operation.
If the data file is password-protected, the <Password> parameter must be specified.
hNoIndexData file indexes are not copied (NDX, SDX and FTX files, if any).
<Progress Bar control>: Optional control name
Name of Progress Bar control found in the window, used to show the progress of copy.
<Password>: Optional string or Secret string
File password (if it exists). This password is required if the hCreateIndex constant is used.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
Remarks

Operating mode of HCopyFile

  • The copied data file is unlocked, as well as the records found in the data file.
  • The index is not copied if it does not exist or if it is corrupt.
  • The password is not required to copy the data file. However, the copied data file remains password-protected.
  • It is not possible to copy data files to a source server of a SPARE replication server.
  • Transaction data file: before copying the data file, it is advisable to:

Use conditions

  • It is also possible to copy a data file from the client workstation to the client workstation.. In this case, this function is equivalent to fCopyFile.
  • This function is used to copy files to an HFSQL server (in Client/Server mode). This function cannot be used with an external server (Oracle or other).
  • To copy an HFSQL data file from a local computer to the server, all the users must have freed such file beforehand. No connection to the data file must be in progress, or the copy will fail. To prevent any new connection to the data file, you can:
  • Replicated data files (replication between servers):
    In the case of a replicated data file, the HCopyFile function must not be used to copy a data file to the server: copying is not possible.. However, a data file can be copied from the server to the client computer.
  • HFSQL cluster
    • If the data files to be copied use enhanced security, you need to specify the password of the data file password with the <Password> parameter. This password is required to synchronize data files on the different nodes.
    • To use HCopyFile with an HFSQL cluster, it is necessary that both the HFSQL cluster and the client application use at least version 2024 Update 1.

Names of data files and directories on the server

  • The names of the data files on the server (.fic, .ndx, .ftx, .sdx and .mmo files, if any) must not contain accented characters.
  • On a LINUX server, the name of the data files must be written in lowercase characters.
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/12/2025

Send a report | Local help