- Syntax 1: Using a character string for the OLE DB provider
- Syntax 1: Pseudo-connection to HFSQL Classic database
- Differences between HOpenConnection and HDescribeConnection
- Using the Native xBase Connector with non-Latin character sets
- UDL file
HDescribeConnection (Function) In french: HDécritConnexion
 Not available with these kinds of connection
Describes a new connection to an external database. This connection is named. Specific parameters can be defined such as the management mode of cursors (if the accessed database allows it). To establish the connection, use HOpenConnection. If the connection parameters described by HDescribeConnection are incorrect, HOpenConnection will return an error. With HDescribeConnection, an Oracle table description imported into the analysis can be directly used by HFSQL Classic data files. Simply describe a temporary connection to an HFSQL Classic database and associate it with the file description from in the analysis. See the Examples for more details. Versions 17 and later New in version 17 Versions 18 and later New in version 18 Versions 21 and later New in version 21 Remark: From version 19, HFSQL is the new name of HyperFileSQL. Syntax
Describing a connection by programming Hide the details
<Result> = HDescribeConnection(<Connection> , <User> [, <Password>] , <Data source> , <Database> , <OLE DB provider or Native Connector> [, <Access> [, <Extended information>]])
<Result>: Boolean - True if the operation was performed,
- False if a problem occurred. HErrorInfo is used to identify the error.
To establish this connection, use HOpenConnection (this function will return an error if the connection parameters are incorrect).
<Connection>: Character string (with quotes) Name of new connection to define. If this name is already used by an existing connection, the former connection is replaced by the new one. The former connection (as well as the data files that used it) are automatically closed. <User>: Character string (with quotes) User name that will be used for the database. This parameter is returned by ..CtUserName. <Password>: Optional character string (with quotes) Connection password (if this password exists). If no password is required, use an empty string ("") or the NULL keyword. <Data source>: Character string (with quotes) Full path of data source. The connection will be created and opened for this data source. This parameter is returned by ..CtDatabase.
<Database>: Character string (with quotes) Name of database that will be used on the data source, empty string ("") if no name must be specified. This parameter can be used if the data source allows you to specify the database that must be used. For example, on SQL Server, the "Master" database is the default database but other databases can be handled ("dbo" for example). To specify that the access is performed on a file found in the "dbo" database (that is not the default database), <Database> must correspond to "dbo". <OLE DB provider or Native Connector>: Character string or constant - Name of OLE DB provider used. To easily retrieve the string to use, select "Connection" in the data model editor (see the Notes).
or - one of the following constants:
| | hAccessHF7 | Pseudo-connection to HFSQL Classic database | hAccessHFClientServer | Native Connector to an HFSQL Client/Server database. | hNativeAccessAS400 | Native AS/400 Connector (optional module of WINDEV/WEBDEV) | hNativeAccessDB2 | Native DB2 Connector (optional module of WINDEV/WEBDEV) | hNativeAccessInformix | Native Informix Connector (optional module of WINDEV/WEBDEV) | Versions 20 and laterhNativeAccessMariaDB New in version 20hNativeAccessMariaDB hNativeAccessMariaDB | Native MariaDB Connector (optional module of WINDEV/WEBDEV) | hNativeAccessMySQL | Native MySQL Connector (optional module of WINDEV/WEBDEV) | hNativeAccessOracle | Native Oracle Connector (optional module of WINDEV/WEBDEV) | hNativeAccessOracleLite | Native Oracle Connector (optional module of WINDEV Mobile) | hNativeAccessPostgreSQL | Native PostgreSQL Connector (optional module of WINDEV/WEBDEV) | hNativeAccessProgress | Native Progress Connector (optional module of WINDEV/WEBDEV) | Versions 16 and laterhNativeAccessSQLAzure New in version 16hNativeAccessSQLAzure hNativeAccessSQLAzure | Native SQL Azure Connector (optional module of WINDEV/WEBDEV, supplied with Native SQL Server Connector) | Versions 16 and laterhNativeAccessSQLite New in version 16hNativeAccessSQLite hNativeAccessSQLite | Native SQLite Connector (supplied with WINDEV/WEBDEV) | hNativeAccessSQLServer | Native SQL Server Connector (optional module of WINDEV/WEBDEV). The former Native Connector is used by default. To force the use of new Native SQL Server Connector, use the H.SQLServerMode variable. | hNativeAccessSQLServerMobile | Native SQL Server Mobile Connector (optional module of WINDEV Mobile) | hNativeAccessSybase | Native Sybase Connector (optional module of WINDEV/WEBDEV) | hNativeAccessXBase | Native xBase Connector (supplied with WINDEV/WEBDEV) | hNativeAccessXML | Native XML Connector (supplied with WINDEV/WEBDEV) | hODBC | OLE DB provider for ODBC (used to access an ODBC data source declared in the ODBC data sources of Windows) | hOledbAccess97 | OLE DB provider for Access 97 | hOledbAccess2000 | OLE DB provider for Access 2000 | hOledbDBase5 | OLE DB provider for dBase 5 | hOledbExcel2000 | OLE DB provider for Excel 2000 | hOledbExcel97 | OLE DB provider for Excel 97 | hOledbLotus4 | OLE DB provider for Lotus 4 | hOledbOracle | OLE DB provider for Oracle | hOledbSQLServer | OLE DB provider for SQL Server |
The available constants are as follows:
| | hAccessHF7 | Pseudo-connection to HFSQL Mobile database | hAccessHFClientServer | Connection to HFSQL Client/Server database | hNativeAccessOracleLite | Native Oracle Lite Connector (optional module) | hNativeAccessSQLServerMobile | Native SQL Server Mobile Connector (optional module) |
 The available constants are as follows:
| | Versions 15 and laterhNativeAccessSQLite New in version 15hNativeAccessSQLite hNativeAccessSQLite | Native SQLite Connector from an Android application. |
<Access>: Optional constant Configures the type of access to the database.
| | hOReadWrite (default value) | The database can be accessed in read/write. You have the ability to read the records and to write new records. | hORead | The database can be accessed in read-only. You only have the ability to read the records. No record can be added or deleted. |
This parameter is returned by ..CtAccess.
<Extended information>: Optional character string (with quotes) Optional information inserted into the string for connecting to the database. If specific keywords are recognized, the corresponding information is extracted from the connection string. The rest of the connection string is sent to the database. Then, the extracted parameters are processed by the Native Connector or by the OLE DB connector used. These keywords must be indicated as follows: "<Keyword> = <Value>;".You can for example specify "Trusted_Connection=YES" in order to use a connection with authentication via the NT login.
This parameter is returned by ..CtExtendedInfo.
Remarks Differences between HOpenConnection and HDescribeConnection Method 1: To open a connection at the start of the application and close it at the end, use HOpenConnection. To use this connection when handling data files or tables, simply change this connection with HChangeConnection.
HOpenConnection(MyConnection, params) // open the connection HChangeConnection(AFile, MyConnection)
Method 2: To describe a connection by programming and to automatically open it when opening the data file, you must: - describe the connection with HDescribeConnection.
- associate this connection with the data file description via HChangeConnection. The connection will be established during the first access to the data file.
This solution can be useful when an application handles both HFSQL data files and Oracle data files. For example, if the application uses a single Oracle file, in a specific process, the connection to the Oracle database will only be made if necessary. If the first solution is chosen for the same type of application, the connection (that may take quite a long time) will be established whenever the application is started. Example:
HDescribeConnection(MyConnection, params) HChangeConnection(AFile, MyConnection) ... HReadFirst(AFile) // Open the connection ... HClose(AFile) // Close the connection
Business / UI classification : Business Logic
This page is also available for…
|
|
|