ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
HRegenerateFile (Function)
In french: HRégénèreFichier
HFSQL ClassicHFSQL Client/ServerAvailable only with these kinds of connection
Regenerates a data file from its log.
Reminder: When a data file is lost, you can regenerate it from its log. To do so, we recommend that you use the tool for log maintenance.
Caution: HRegenerateFile recreates a data file from the log description.

This function is an advanced function. Used wrongly, this function can destroy or corrupt the data.
Example
// The "Customer" data file has a log.
// The "Customer" data file is in the "C:\Data" directory.
// The log of the data file "Customer.fic" is in the "C:\Log" directory.
// The "Customer" data file has been destroyed.
// Rebuild data file from log
HRegenerateFile("C:\Log\CustomerJNL.fic", hStructure + hData)
Syntax
WINDEVHFSQL ClassicHyper File 5.5

Regenerating the data file in HFSQL Classic mode Hide the details

<Result> = HRegenerateFile(<Log file> [, <Password> [, <Destination directory>]] [, <Options> [, <Start date and time of restore operation> [, <End date and time of restore operation> [, <Progress bar of restore operation> [, <Reindexing progress bar>]]]]])
<Result>: Boolean
  • True if the data file was regenerated,
  • False otherwise. HError is used to identify the error.
<Log file>: Character string
Full name of the log file to use.
<Password>: Optional character string
  • Password of the log file (identical to the password defined for the data file). This password is mandatory to specify a destination directory.
  • Empty string ("") if there is no password.
<Destination directory>: Optional character string
Full name of the directory where the data file will be regenerated.
If this parameter is not defined, the data file is regenerated in its source directory.
<Options>: Optional constant (or combination of constants)
Configures the regeneration of the file. The function has no effect by default (no selected option).
hDataAll the operations stored in the log file are applied to the existing data file. The file data is updated from the data found in the log.
hStructureA new empty data file is created from the description of the data file in the log file. If the data file already exists, it is deleted then re-created.
<Start date and time of restore operation>: Character string or optional DateTime variable
Date and time (in YYYYMMDDHHmmSSCCC format: YYYY: year, MM: month, DD: day, HH: hour, mm: minutes, SS: seconds, CCC: hundredths of a second) from which the operations in the log file will be replayed on the backup file. The data file will be updated. If no date and time is specified, all the operations found in the log file will be replayed.
<End date and time of restore operation>: Character string or optional DateTime variable
Date and time (in YYYYMMDDHHmmSSCCC format: YYYY: year, MM: month, DD: day, HH: hour, mm: minutes, SS: seconds, CCC: hundredths of a second) up to which the operations in the log file will be replayed on the backup file. The data file will be updated. If no date and time is specified, all the operations found in the log file will be replayed.
<Progress bar of restore operation>: Optional control name
Name of the Progress Bar control in the current window. This control will be used to view the progress of the restore operation.
<Reindexing progress bar>: Optional control name
Name of the Progress Bar control in the current window. This control will be used to view the progress of the reindex operation (once the data is restored).
WINDEVHFSQL Client/Server

Regenerating the data file in HFSQL Client/Server mode Hide the details

<Result> = HRegenerateFile(<Connection> , <Log file> [, <Password> [, <Destination directory>]] [, <Options> [, <Start date and time of restore operation> [, <End date and time of restore operation> [, <Progress bar of restore operation> [, <Reindexing progress bar>]]]]])
<Result>: Boolean
  • True if the data file was regenerated,
  • False otherwise. HError is used to identify the error.
<Connection>: Character string
Connection for which the database must be regenerated. This connection corresponds to:
<Log file>: Character string
Name of the log file to use. The path of this file is relative to the JNL database of the connection (see Structure of log files in Client/Server mode).
<Password>: Optional character string
  • Password of the log file (identical to the password defined for the data file). This password is mandatory to specify a destination directory.
  • Empty string ("") if there is no password.
<Destination directory>: Optional character string
Name of the directory where the data file will be regenerated. This directory is relative to the database defined by the connection. If this parameter is not defined, the data file is regenerated in its source directory.
<Options>: Optional constant (or combination of constants)
Configures the regeneration of the data file. The function has no effect by default (no selected option).
hDataAll the operations stored in the log file are applied to the existing data file. The file data is updated from the data found in the log.
hStructureA new empty data file is created from the file description found in the log file. If the data file already exists, it is deleted then re-created.
<Start date and time of restore operation>: Character string or optional DateTime variable
Date and time (in YYYYMMDDHHmmSSCCC format: YYYY: year, MM: month, DD: day, HH: hour, mm: minutes, SS: seconds, CCC: hundredths of a second) from which the operations in the log file will be replayed on the backup file. The data file will be updated. If no date and time is specified, all the operations found in the log file will be replayed.
<End date and time of restore operation>: Character string or optional DateTime variable
Date and time (in YYYYMMDDHHmmSSCCC format: YYYY: year, MM: month, DD: day, HH: hour, mm: minutes, SS: seconds, CCC: hundredths of a second) up to which the operations in the log file will be replayed on the backup file. The data file will be updated. If no date and time is specified, all the operations found in the log file will be replayed.
<Progress bar of restore operation>: Optional control name
Name of the Progress Bar control in the current window. This control will be used to view the progress of the restore operation.
<Reindexing progress bar>: Optional control name
Name of the Progress Bar control in the current window. This control will be used to view the progress of the reindex operation (once the data is restored).
Remarks
HRegenerateFile can only be used on HFSQL Classic or Client/Server data files that have logs.
Component: wd290hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help