Opens an xBase index file. The index files of a data file in xBase format opened by
HDBOpen must necessarily be opened by
HDBIndex in order to be used by WINDEV and WEBDEV. If the index files are not opened, they will not be updated when the write-to-file operation is performed.
Remark: there is no need to open the data file or the index files if the file was just created by
HDBCreation.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
HDBOpen("CUSTOMER", "CU", "C:\FILE\CUSTOMER.DBF")
HDBIndex("CUSTOMER", "C:\FILE\CUSTNAME.NTX", "CustName")
HDBIndex("CUSTOMER", "C:\FILE\CUSTPHONE.NTX", "Phone")
Syntax
<Result> = HDBIndex(<Logical name of xBase file> , <Full name of index file> , <Key name>)
<Result>: Boolean
- True if the operation was performed,
- False if a problem occurred. HError is used to identify the error.
<Logical name of xBase file>: Character string (with quotes)
Name given to the xBase file. This file was opened by HDBOpen.
<Full name of index file>: Character string (with quotes)
Access path to index file and full file name (with the extension)
<Key name>: Character string (with quotes)
Name of index key. This parameter is mandatory for the files in .NDX, .NTX and .IDX format (indeed, the name of the key does not appear in the file). It is useless and ignored for files in .MDX format (because the key name appears in the file).
Remarks
If the key is a calculated key (multiple), you must not specify all the items included the key, but any name that will be used in programming. For clarity, the name of the corresponding index file is often used.
- This function is not available when accessing a database via Remote Access.
- This function is not available when using a stand-alone executable.