PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Characteristics of created data file
  • The different created files
  • Managing the password
  • Managing the fatal errors when creating a data file
  • Managing non-Latin character sets
  • Replication: Range of identifiers
  • Priority for defining the location of log files
  • Creating an existing table
  • Constraints for referential integrity
  • OLE DB Oracle: Creating a table containing a binary memo
  • OLE DB: Creating a table containing automatic identifiers
  • Managing indexes
  • Creating the data file from its description
  • DATE and TIME items with the Native SQL Server Access
  • HCreation function and Native SQLite Access
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
Creates an empty data file (.FIC extension) with the index file and the memo file if necessary.
This function can also be used to delete all the records from a data file. In this case, the record in memory is not canceled. To initialize it, use HReset.
Note: The automatic creation of the non-existing data files can be enabled during the description of the project ("Files" tab of the project description, "Automatically create the data files if not found at opening" option). HCreation is automatically used if the data file does not exist when it is handled for the first time.
WINDEVWEBDEV - Server codeHFSQL If the data file is logged, you have the ability to specify the location of the log files.
HFSQL Client/Server If integrity constraints have been defined and if they are supported, the links are updated on the server.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
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
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
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.
Universal Windows 10 App This function is now available in Windows Store apps mode.
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.
// Create the Orders file (described in the analysis)
HCreation(Orders)
Syntax
<Result> = HCreation(<File Name> [, <Password> [, <Path of JNL File> [, <Path of JournalOpération File> [, <Option>]]]])
<Result>: Boolean
  • True if the data file was created,
  • False if a problem occurred. HError is used to identify the error. If a fatal error occurs, a specific process is required to continue the program and to check whether the data file was created (see the Notes).
<File Name>: Character string (with or without quotes)
Name of data file to create.
Native Accesses MySQL: the table name must contain no accented character (for example: "ÉlanFile"). This is a problem specific to MySQL (tested on versions 3.23.52-max-nt and 3.23.47-max-nt of the MySQL server).
<Password>: Optional character string (with quotes)
  • Password associated with the data file.
    HFSQLHFSQL Client/Server The password of the HFSQL files is not sensitive to the case.
  • Empty string ("") if no password is used.
<Path of JNL File>: Optional character string (with quotes)
Access path to the JNL file associated with the logged data file. This parameter is taken into account if the data file is logged. In this case, <File Name>JNL.fic will be created at the specified location.
Windows Mobile This parameter must not be specified. Indeed, the log process is not supported by HFSQL Mobile. This limit is due to the optimization of the size of applications for Pocket PC.
HFSQL Client/Server This parameter must not be specified. In HFSQL Client/Server, the path of the JNL file is defined and it cannot be modified.
AndroidAndroid Widget iPhone/iPadPHP This parameter is ignored.
Java Access by JDBC: This parameter is ignored.
<Path of JournalOpération File>: Optional character string (with quotes)
Access path to JournalOpération file and to JournalIdentification file associated with the logged file. The JournalOpération file contains all the operations performed on the logged file. This parameter is taken into account if the data file is logged.
Windows Mobile This parameter must not be specified. Indeed, the log process is not supported by HFSQL Mobile. This limit is due to the optimization of the size of applications for Pocket PC.
HFSQL Client/Server This parameter must not be specified. In HFSQL Client/Server, the path of the operation file is set and it cannot be modified.
AndroidAndroid Widget iPhone/iPadPHP This parameter is ignored.
Java Access by JDBC: This parameter is ignored.
<Option>: Optional Integer constant
Options for creating the data file:
hChangeCharsetThe character set defined by ChangeCharset will be taken into account in the new data file. The sorts, the searches, ... on string keys (strings, characters, date and time) will be performed according to this character set.
hNoLinkManagement of integrity: The links are not updated on the server (creation, modification or deletion).
Reminder: by default, the links are updated on the server when a data file is created.
HFSQL Client/Server This constant is available in HFSQL Client/Server mode only.
PHP This parameter is ignored.
Java Access by JDBC: This parameter is ignored.
Versions 15 and later
AndroidAndroid Widget This parameter is ignored.
New in version 15
AndroidAndroid Widget This parameter is ignored.
AndroidAndroid Widget This parameter is ignored.
Remarks
WINDEVWEBDEV - Server codeiPhone/iPadWindows MobileUniversal Windows 10 AppJavaAjaxHFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Accesses

Characteristics of created data file

The characteristics of the created data file are as follows:
  • Name of data file:
    Physical name defined during the description of the data file in the data model editor. This name can be modified before the data file is created by HChangeName.
  • Directory of data file:
    Directory defined during the description of the data file in the data model editor. This directory can be modified before the data file is created by HChangeDir and HSubstDir.
  • Content of data file:
    The created data file is empty, which does not mean that its size is null (the file contains a header describing its structure).
  • The order of the items created in the physical file is the physical order of the items created in the analysis (and not the logical order).
If the data file already existed: If the data file already existed (same name, same directory), this data file is recreated: the data file contains no record. The index file and the memo file (if they exist) are also recreated. In this case, the integrity constraints are not checked.
Caution: Re-creating the data file is possible only if the data file is not used by another application. If a file currently used must be cleared, call HDelete during a browse. You also have the ability to use HDeleteAll to delete all the records from a data file.
WINDEVWEBDEV - Server codeiPhone/iPadWindows MobileUniversal Windows 10 AppAjaxHFSQLHFSQL Client/ServerStored proceduresHyper File 5.5

The different created files

When creating a data file, the following files can be created in addition to the data file:
  • An index file (".NDX" extension) if one or more keys have been defined in the description of the data file.
  • A memo file (".MMO" extension) if one or more memo items have been defined in the description of the data file.
  • A log file (".JNL extension). This file is created only if the corresponding option was selected during the description of the data file.
    AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppPHP This file is not created.
  • A <ProjectName>.REP file. This file contains the list of data files handled by the application. This file is created (or filled) if the management of .REP is enabled (HSetREP). See .REP file for more details.
    Windows Mobile HCreation creates a physical file. This function fills the list of data files if the update of this list is enabled. See List of data files handled by an application for more details.
    iPhone/iPadUniversal Windows 10 App This file is not created.

Managing the password

  • The password can be defined:
    • when the data file is created by HCreation.
    • before the data file is created by HPass.
  • If the data file existed and if it was password protected, the data file is re-created, even if the password changes or does not exist anymore.
Caution: The password is independent of data encryption. The data encryption must be configured during the description of the data file in the data model editor ("Details" tab).
PHPNative Accesses The password is not associated with a data file but with a database. This password must be specified during the connection (HConnect).

Managing the fatal errors when creating a data file

If a fatal error occurs when creating a data file, it may be interesting to continue the program while checking whether the data file was created or not. To do so, we recommend that you perform the following exception process:
WHEN EXCEPTION IN
HCreation(PARENT)
DO
Error("HFSQL error: " + HError())
ELSE
Trace("The file is created")
END
WINDEVWEBDEV - Server codeiPhone/iPadWindows MobileUniversal Windows 10 AppAjaxHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Accesses

Managing non-Latin character sets

If the hChangeCharset constant is specified, the character set used in the data file will be the one specified by ChangeCharset. The sorts, the searches, ... on string keys (strings, characters, date and time) will be performed according to this character set.
The character set used can be modified by HIndex.
Note: The size of the string items specified in the analysis is expressed in bytes and not in characters. Depending on the character set used, you may have to increase the size of the item (if the characters used are coded on 2 bytes for example).
WINDEVWEBDEV - Server codeAjaxHFSQLHFSQL Client/ServerHyper File 5.5

Replication: Range of identifiers

The automatic identifiers of the files of subscriber replicas use a range of identifiers that differs from the one used by the file of master replica and by the other files of subscriber replicas.
This range of automatic identifiers is written in the header of each data file (".FIC" extension).
This range is initialized:
WINDEVWEBDEV - Server codeWindows MobileAjaxHFSQLHyper File 5.5

Priority for defining the location of log files

The location of log files is defined according to the following priority order:
  1. Location specified when creating the logged data file (HCreation).
  2. Location specified by HChangeLogDir.
  3. Location specified in the analysis.
  4. Location of logged data file.
If another application is using HDeclareExternal on a logged data file, the modifications performed by this application are saved in the log files specified in the header of the logged HFSQL data file.
HFSQL Client/Server The location of Log files is fixed and it cannot be modified. See Log files in Client/Server mode for more details.
WINDEVWEBDEV - Server codeWindows MobileAjaxStored proceduresOLE DB

Creating an existing table

If the table already existed, HCreation tries to delete and to re-create the table.
For example: Using an Oracle database
  • with the OLE DB "MSDAORA" provider: a new table cannot be created. If the table already exists, the records are erased.
  • with the OLE DB "oraOLEDB.Oracle" provider: the creation of a new table is possible as well as the re-creation of an existing table. However, no index or memo item can be created.
When creating a table, WINDEV and WEBDEV try to create the items in the OLE DB type corresponding to the HFSQL type. If this type is not supported, WINDEV and WEBDEV successively try all the "compatible" OLE DB types until they find a type supported by the OLE DB database.
WINDEVWEBDEV - Server codeWindows MobileJavaPHPAjaxOLE DBNative Accesses

Constraints for referential integrity

When creating a table, the referential integrity constraints described in the analysis are not created on the database.
OLE DB

OLE DB Oracle: Creating a table containing a binary memo

Caution: creating an Oracle table containing binary memos fails in Oracle 7.x (because the LOBs are not supported in this version of Oracle).
OLE DB

OLE DB: Creating a table containing automatic identifiers

The automatic identifier will be created in the table only if the OLE DB provider supports the automatic identifiers.
WINDEVWEBDEV - Server codeWindows MobileJavaPHPNative Accesses

Managing indexes

If an index failed to be added, no error message is returned by HCreation. The table is created without the index that is causing the problem. In this case, duplicates may be found in an item defined as unique key by WINDEV and WEBDEV if the external database does not support the unique keys.

Creating the data file from its description

The data file can be directly created from its description in the data model editor. To do so, select "Create the data file" and select the directory where the data file must be created.
Native Accesses

DATE and TIME items with the Native SQL Server Access

When using HCreation, the Native SQLServer Server creates DATE and TIME items if the version of the server and the version of the client layer correspond to SQL Server 2008 (or later).
Native Accesses

HCreation function and Native SQLite Access

HCreation may fail ("database table is locked" error) if the following conditions are fulfilled:
  • the file to create already exists.
  • a browse is in progress on another file of the same database.
This is caused by a limitation of SQLite database.
Components
WINDEVWEBDEV - Server code wd220hf.dll
Windows Mobile wp220hf.dll
Java wd220java.jar
Linux wd220hf.so
Android wd220android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment