|
|
|
|
|
HImportXLS (Function) In french: HImporteXLS
 Available 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
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.
<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: | | hCopyAutoID | The automatic identifier is copied. It is not recalculated. | hDefaultVal | For 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.
| hImpBreakable | The 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. | hImpCreation | If the data file to be imported exists, it is overwritten. | hImpIgnoreEmptyItem | If 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.
| hImpIgnoreFirstLine | The 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.
| hImpTestDuplicates | Checks for duplicate values on unique keys during an import operation (enabled only on unique keys, not on the entire record).
| hImpTestIntegrity | Checks data integrity during an import operation.
|
<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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|