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 functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
HImportXLS (Function)
In french: HImporteXLS
HFSQL ClassicHFSQL Client/ServerAvailable only with these kinds of connection
Imports an XLS or XLSX file into an HFSQL Classic or Client/Server data file. This data file must have been defined in the data model editor, or declared with HDeclare, HDeclareExternal or HDescribeFile).
New in version 2025
Java This function is now available for Java applications.
Example
// Import "C:\MyFiles\Customer.xls" into the Customer data file. 
// The Customer data file will be overwritten if it already exists (hImpCreation constant)
// A progress bar will be displayed in PROGBAR_ProgBar1
HImportXLS(Customer, "C:\MyFiles\Customer.xls", 1, "", hImpCreation, PROGBAR_ProgBar1)
Syntax
<Result> = HImportXLS(<Data file> , <Path of the XLS or XLSX file> [, <Worksheet number> [, <List of destination items> [, <Options> [, <Progress Bar>]]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if an error occurs.
    HError is used to identify the problem.
<Data file>: Character string
Name of the HFSQL data file to import into.
Note: If the HFSQL data file being handled does not physically exist, this data file is automatically created.
<Path of the XLS or XLSX file>: Character string
Full access path to XLS or XLSX file to import.
Linux Only the XLSX files can be used.
<Worksheet number>: Optional integer
Worksheet number in the XLS or XLSX file to import.
If this parameter is not specified, the first worksheet in the XLS or XLSX file will be imported.
<List of destination items>: Optional character string
List of names of items in the data file into which the import will be performed. Names can be delimited by single quotes and are separated by commas or CR characters.
The names of the composite key items, binary memo items and binary items are ignored.
The non-imported items will be initialized with their default value described in the analysis.
If this parameter is not specified or is an empty string, all fields are imported (except compound keys, binary fields and binary memos) in the physical order of description.
<Options>: Optional Integer constant (or combination of constants)
Configures the type of import to perform:
hCopyAutoIDThe automatic identifier is copied. It is not recalculated.
hDefaultValFor non-imported items, the values of the current record are reinitialized:
  • with their default value if the hDefaultVal constant is specified.
  • with the value of the corresponding items in the current record before calling HImportXLS, if the hDefaultVal constant is not specified.
hImpBreakableThe import can be interrupted by pressing the Esc key on the keyboard.
If the import is interrupted, the imported records are kept in the data file.
hImpCreationIf the data file to be imported exists, it is overwritten.
hImpIgnoreEmptyItemIf one or more items are not populated in the XLS file, the corresponding rows are still imported.
The missing items contain:
  • the default value of the items if the hDefaultVal constant is specified.
  • the value of the items in the current record before calling HImportXLS.
hImpIgnoreFirstLineThe first row of the imported XLS file is ignored.
hImpNormal
(default value)
If the data file into which the data is to be imported already exists, it is filled with the imported data, otherwise the data file is created.
No management of integrity and no management of duplicates.
Non-imported items take the value of the current record.
Automatic identifiers are recalculated.
OLE DBNative Connectors (Native Accesses) Data integrity and duplicates are always checked.
hImpTestDuplicatesChecks for duplicate values on unique keys during an import operation (enabled only on unique keys, not on the entire record).
OLE DBNative Connectors (Native Accesses) Always checks for duplicate values.
hImpTestIntegrityChecks data integrity during an import operation.
OLE DBNative Connectors (Native Accesses) Data integrity is always checked.
<Progress Bar>: Optional control name or window name
  • Name of the window in which the progress bar will be displayed,
  • Name of the Progress Bar control.
Component: wd300hf.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/07/2024

Send a report | Local help