PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Operating mode of HCopyFile
  • 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
HCopyFile (Function)
In French: HCopieFichier
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 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications (for the HFSQL data files).
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.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications (for the HFSQL data files).
Java This function is now available for the Java applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications (for the HFSQL data files).
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.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
// Copy the files from server to server
// while renaming and changing directory
HCopyFile(MyConnection, ".\backup\customerfile_bck.fic", MyConnection, ".\customerfile.fic")
// Copy the files from the server to the client computer
HCopyFile("", "C:\Data\Customer.fic", MyConnection, "customer.fic")
// Copy the files from the client computer to the server
HCopyFile(MyConnection, "customer.fic", "", "C:\Data\Customer.fic")
// Copies the files from a server to another server
HCopyFile("CNT", "customer.fic", "CNT2", "dir\customer.fic", hNoIndex, PROGBAR_MyProgressBar)
// Copies the CUSTOMER file from a client onto itself (backup)
sMyDestinationDirectory is string = CompleteDir(fExeDir()) + "TestDirectory"
IF NOT fDirectoryExist(sMyDestinationDirectory) THEN fMakeDir(sMyDestinationDirectory)
HCopyFile("", sMyDestinationDirectory + "CUSTOMER.FIC", "", ...
CompleteDir(fExeDir()) + "CUSTOMER.FIC", hCopyIndex)
Android
// Example for using HCopyFile in Android
// (from the HFSQL C/S server onto the Android device)
HFCSConnection is Connection

// Connection parameters
HFCSConnection..Provider = hAccessHFClientServer
HFCSConnection..User = "admin"
HFCSConnection..Password = ""
HFCSConnection..Server = "192.168.40.26"
HFCSConnection..Database = "mydatabase"

sDBPath is string = (SysDirStorageCard() + [fSep] + ProjectInfo(piProjectName)

IF NOT HCopyFile("", sDBPath + [fSep] + "copy/customer.fic", ...
HFCSConnection, CUSTOMER..Name + ".fic") THEN
Error(HErrorInfo(hErrFullDetails))
END
Syntax
<Result> = HCopyFile(<Name of Destination Connection> , <Path of Destination File> , <Name of Source Connection> , <Path of Source File> , <Mode> , <Progress Bar> , <Password>)
<Result>: Boolean
  • True if the data file was copied,
  • False if an error occurred. HError is used to identify the error.
<Name of Destination Connection>: Character string (with or without quotes)
Name of connection into which the data file will be copied. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
If this parameter corresponds to an empty string (""), the data file will be copied onto the client computer.
<Path of Destination 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.
<Name of Source Connection>: Character string (with or without quotes)
Name of connection from which the data file will be copied. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
If this parameter corresponds to an empty string (""), the data file to copy is found on the client computer.
<Path of Source 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.
<Mode>: Integer constant
The mode used can correspond to one of the following constants:
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>: Character string (with or without quotes)
Name of Progress Bar control found in the window, used to show the progress of copy.
<Password>: Character string (with quotes)
File password (if it exists). This password is required if the hCreateIndex constant is used.
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 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 also have the ability to copy a data file from the client computer to this 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 a HFSQL file found on a local computer to the server, this file must have been freed beforehand by all the users. No connection to the file must be in progress otherwise the copy will fail.
  • Case of replicated files (replication between servers): For a replicated file, HCopyFile must not be used to copy a file to the server: the copy is not possible. However, a 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 an LINUX server, the name of files must be written in lowercase characters.
Components
WINDEVWEBDEV - Server code wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment