PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

This content comes from an automatic translation.
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
HDeclareExternal (Function)
In french: HDéclareExterne
ODBCNot available with this kind of connection
Temporarily imports into the current analysis the description of a data file from an existing HFSQL data file. This data file is opened. To no longer use this file description, call HCancelDeclaration.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
WEBDEV - Server codeAjax
// Declaration of a data file SupplierWD from the complete path
// of HFSQL Classic file (.FIC extension included)
HDeclareExternal("C:\SalesMgt\Supplier.fic", "WDSupplier")
IF ErrorOccurred = True THEN
// Error while declaring the file, display the error
Error(HErrorInfo())
END
Syntax
WEBDEV - Server codeAjaxHFSQL

Use with Classic HFSQL files (single-user or multi-user) Hide the details

<Result> = HDeclareExternal(<Full path of HFSQL file> , <Alias> [, <Password>])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HErrorInfo is used to identify the error.
<Full path of HFSQL file>: Character string (with quotes)
Full access path to HFSQL data file whose description will be imported (up to 260 characters). This name must contain the path and extension of data file.
If HDeclareExternal is used in a stored procedure, the file path must be relative to the current database.
<Alias>: Character string (with quotes)
Logical name of data file. This name will be used to handle the data file. This name can also correspond to a Data Source variable.
<Password>: Optional character string (with or without quotes)
  • Password associated with the data file.
  • Empty string ("") if no password is used.
The password is kept if it is specified: there is no need to specify this password again in the next functions for handling the data file.
WEBDEV - Server codeAjaxHFSQL Client/ServerOLE DBNative Connectors (Native Accesses)

Use with an OLE DB access, a Native Connector, HFSQL Client/Server and an existing connection Hide the details

<Result> = HDeclareExternal(<Data file> , <Alias> , <Connection>)
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HErrorInfo is used to identify the error.
<Data file>: Character string (with quotes)
Name of data file in the external database.
HFSQL Client/Server This parameter corresponds to the physical name of data file, in relation to the database (extension included). Example: "myfile.fic" (or if the database has sub-directories: ".\directory\myfile.fic").
If the data file is password protected, this password must be specified with HPass before using HDeclareExternal.
<Alias>: Character string (with quotes)
Logical name of data file. This name will be used to handle the data file in the current application. This name can also correspond to a Data Source variable.
<Connection>: Character string (with quotes)
Connection to a database. This connection was defined in the data model editor or by programming via HDescribeConnection.
WEBDEV - Server codeAjaxOLE DBNative Connectors (Native Accesses)

Use with an OLE DB access or a Native Connector Hide the details

<Result> = HDeclareExternal(<Data file> , <Alias> , <User> [, <Password> [, <Data source> [, <OLE DB provider or Native Connector> [, <Access>]]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HErrorInfo is used to identify the error.
<Data file>: Character string (with quotes)
Name of data file in the external database.
<Alias>: Character string (with quotes)
Logical name of data file. This name will be used to handle the data file in the current application.
<User>: Character string
Name of user of the data source.
<Password>: Optional character string
Password of data file to open (if this password exists).
<Data source>: Optional character string
Full path of data source.
<OLE DB provider or Native Connector>: Optional character string
Name of OLE DB provider or one of the following constants:
hNativeAccessAS400Native AS/400 Connector (optional module)
hNativeAccessDB2Native DB2 Connector (optional module)
hNativeAccessInformixNative Informix Connector (optional module)
Versions 20 and later
hNativeAccessMariaDB
New in version 20
hNativeAccessMariaDB
hNativeAccessMariaDB
Native MariaDB Connector (optional module of WINDEV/WEBDEV)
hNativeAccessMySQLNative MySQL Connector (optional module)
hNativeAccessOracleNative Oracle Connector (optional module)
hNativeAccessPostgreSQLNative PostgreSQL Connector (optional module of WINDEV/WEBDEV)
hNativeAccessProgressNative Progress Connector (optional module)
Versions 16 and later
hNativeAccessSQLAzure
New in version 16
hNativeAccessSQLAzure
hNativeAccessSQLAzure
Native SQL Azure Connector (optional module, supplied with Native SQL Server Connector)
Versions 15 and later
hNativeAccessSQLite
New in version 15
hNativeAccessSQLite
hNativeAccessSQLite
Native SQLite Connector
hNativeAccessSQLServerNative SQL Server Connector (optional module)
hNativeAccessSybaseNative SYBASE Connector (optional module)
hNativeAccessXBaseNative xBase Connector
hNativeAccessXMLNative XML Connector
hODBCOLE DB provider for ODBC. Used to access an ODBC source declared in the ODBC data sources of Windows
hOledbAccess97OLE DB provider for Access 97
hOledbAccess2000OLE DB provider for Access 2000
hOledbAccess2007OLE DB provider for Access 2007
Versions 19 and later
hOledbAccess2010
New in version 19
hOledbAccess2010
hOledbAccess2010
OLE DB provider for Access 2010
hOledbDBase5OLE DB provider for dBase 5
hOledbExcel2000OLE DB provider for Excel 2000
hOledbExcel2007OLE DB provider for Excel 2007
hOledbExcel97OLE DB provider for Excel 97
hOledbLotus4OLE DB provider for Lotus 4
hOledbOracleOLE DB provider for Oracle
hOledbSQLServerOLE DB provider for SQL Server
Caution: To use an OLE DB connection, you must:
  • install MDAC version 2.6 or later (setup performed by WINDEV/WEBDEV and when creating the client version)
  • install the OLE DB provider corresponding to the database used.
<Access>: Optional constant
Configures the type of access to the data file.
hOReadWrite
(default value)
The data file can be accessed in read/write. You have the ability to read the records and to write new records.
hOReadThe data file can be accessed in read-only. You only have the ability to read the records. No record can be added or deleted.
Remarks
  • All the HFSQL functions can be used on the imported data file except for the integrity management.
  • You can import as many descriptions as necessary.
  • This function can be used with data files in XML format.
  • The second syntax of this function cannot be used during an access to a database via Remote access.
  • To use HDeclareExternal in a stored procedure:
    • the relative path of the data file must be specified in relation to the directory of the database containing the stored procedure. The path must include the name and extension of the data file.
    • no connection must be used: the current database on which the stored procedure is found will be used.
  • By default, if the current project:
    • is associated with an analysis, the lock mode applied to the data files is the multi-user mode (the files are not locked when they are opened and they can be accessed by the other applications).
    • is not associated with an analysis, the lock mode performed on the data files is the single-user mode: the files are locked in read/write mode as soon as they are opened. This mode prevents the other applications from accessing the files already opened by the current application.
Related Examples:
WD External file Training (WINDEV): WD External file
[ + ] This program, powered by WINDEV, explains how to handle files not described in the analysis.
You have the ability ot use the WLanguage functions named HDeclare or HDeclareExternal.
The differences of behavior regarding these two declaration modes of the file are highlighted in this example.
Component : wd250hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment