PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE


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.
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
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps 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.
Versions 19 and later
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
WINDEVJava This function is now available for the Java applications.
New in version 19
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
WINDEVJava This function is now available for the Java applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
WINDEVJava This function is now available for the Java applications.
AndroidAndroid Widget Java This function is available for the HFSQL Classic or Client/Server data files only.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)
// Declare a WDSupplier file from the full 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
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)HFSQL

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

<Result> = HDeclareExternal(<Full Path of File> , <Alias Name> [, <Password>])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HErrorInfo is used to identify the error.
<Full Path of 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 Name>: 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.
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadWindows MobileJavaAjaxUser code (UMC)HFSQL Client/ServerOLE DBNative Accesses

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

<Result> = HDeclareExternal(<File Name> , <Alias Name> , <Connection Name>)
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HErrorInfo is used to identify the error.
<File Name>: 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 Name>: 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 Name>: Character string (with quotes)
Name of connection to a database. This connection was defined in the data model editor or by programming via HDescribeConnection.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileAjaxUser code (UMC)OLE DBNative Accesses

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

<Result> = HDeclareExternal(<File Name> , <Alias Name> , <User Name> [, <Password> [, <Data Source> [, <OLE DB Provider or Native Access> [, <Access>]]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HErrorInfo is used to identify the error.
<File Name>: Character string (with quotes)
Name of data file in the external database.
<Alias Name>: Character string (with quotes)
Logical name of data file. This name will be used to handle the data file in the current application.
<User Name>: 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 Access>: Optional character string
Name of OLE DB provider or one of the following constants:
hNativeAccessAS400Native AS/400 access (optional module)
hNativeAccessDB2Native DB2 access (optional module)
hNativeAccessInformixNative Informix access (optional module)
Versions 20 and later
hNativeAccessMariaDB
New in version 20
hNativeAccessMariaDB
hNativeAccessMariaDB
Native MariaDB Access (optional module of WINDEV/WEBDEV)
hNativeAccessMySQLNative MySQL access (optional module)
hNativeAccessOracleNative Oracle access (optional module)
hNativeAccessPostgreSQLNative PostgreSQL Access (optional module of WINDEV/WEBDEV)
hNativeAccessProgressNative Progress access (optional module)
Versions 16 and later
hNativeAccessSQLAzure
New in version 16
hNativeAccessSQLAzure
hNativeAccessSQLAzure
Native SQL Azure access (optional module, supplied with the Native SQL Server Access module)
Versions 15 and later
hNativeAccessSQLite
New in version 15
hNativeAccessSQLite
hNativeAccessSQLite
Native SQLite access
hNativeAccessSQLServerNative SQL Server access (optional module)
hNativeAccessSybaseNative Sybase access (optional module)
hNativeAccessXBaseNative xBase access
hNativeAccessXMLNative XML access
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.
Windows Mobile The available constants are as follows:
hNativeAccessOracleNative Oracle Lite Access (optional module)
hNativeAccessSQLServerNative SQL Server CE Access (optional module)
<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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment