PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

New WINDEV, WEBDEV, WINDEV Mobile 25 feature!
  • Operating mode of <Connection variable>.CopyFile
  • Use conditions
  • Names of data files and directories on the server
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
<Connection variable>.CopyFile (Function)
In french: <Variable Connexion>.CopieFichier
HFSQL Client/ServerAvailable only with this kind of connection
Copies a HFSQL data file (.fic, .ndx, .ftx and .mmo files if they exist):
  • 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 a HFSQL server to antoher HFSQL server.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Java This function is now available for the Java applications.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Java This function is now available for the Java applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Java This function is now available for the Java applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Describe the connection
MyConnection is Connection
 
// Copy the data files from server to server
// while renaming and changing directory
MyConnection.CopyFile(".\backup\customerfile_bck.fic", MyConnection, ".\customerfile.fic")
// Describe the connection
MyConnection is Connection
 
// Copy the data files from the client computer to the server
MyConnection.CopyFile("customer.fic", "", "C:\Data\Customer.fic")
// Describe the connection
MyConnection1 is Connection
MyConnection2 is Connection
 
// Copies the data file(s) from a server to another server
MyConnection1.CopyFile("customer.fic", MyConnection2, "dir\customer.fic", hNoIndex, PROGBAR_MyProgressBar)
Syntax
<Result> = <Destination connection>.CopyFile(<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 occurred. HError is used to identify the error.
<Destination connection>: Connection variable
Name of the Connection variable that describes the connection in which the data file must be copied.
<Destination data file>: Character string (with quotes)
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.
Caution: the extension of '.fic' file must be specified.
<Source connection>: Character string (with or without quotes) or Connection variable
Connection from which the data file must be copied. This connection corresponds to:
<Source data file>: Character string (with quotes)
Name and path of source data file (to copy). If the source data file is found on the server, the path is relative to the database.
Caution: the extension of '.fic' file must be specified.
<Copy mode>: Optional Integer constant
Copy mode used:
hCopyIndexThe file indexes are copied (NDX file and FTX file if it exists).
hCopyIfNotFoundCopies the data file only if it does not exist at the specified location on the destination computer.
hCreateIndexThe file indexes are not copied (NDX file and FTX file if it exists). They are automatically re-created on the destination via a reindex operation.
If the data file is password protected, the <Password> parameter must be specified.
hNoIndexThe file indexes are not copied (NDX file and FTX file if it exists).
<Progress Bar control>: Optional control name
Name of Progress Bar control found in the window, used to show the progress of copy.
<Password>: Optional character string (with quotes)
File password (if it exists). This password is required if the hCreateIndex constant is used.
Remarks

Operating mode of <Connection variable>.CopyFile

  • 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 corrupted.
  • The password is not required to copy the data file. However, the copied data file remains password protected.
  • Data file in transaction: before copying the data file, we advise you to:

Use conditions

  • You can also copy a data file from the client computer to the same client computer. In this case, this function is equivalent to fCopyFile.
  • This function is used to copy files to a 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.
  • Case of replicated data files (replication between servers): For a replicated data file, <Connection variable>.CopyFile must not be used to copy a data file to the server: the copy is not possible. However, a data file can be copied from the server to the client computer.

Names of data files and directories on the server

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