In french: HChangeConnexion
Not available with this kind of connection
Dynamically changes the connection associated with a data file. The new connection must be known and defined during this change. This new connection will be used during the next opening of the data file.
This allows you to import a description of Oracle tables into the analysis and to use this description to work on data files in HFSQL format. For more details, see the detailed examples.
// Describe the new connection
HDescribeConnection("MyConnection", "", "", ...
"Server_SQLServer", "dbo", hOledbSQLServer, hOReadWrite, "")
// Establish the new connection
// Specify that "Salaries" uses the new connection
// Start looping through the "Salaries" table on SQLServer
// Close the connection
// Restore the use of connection on Oracle
// Open the "Salaries" table on Oracle
<Result> = HChangeConnection(<Data file> , <New connection>)
- True if the operation was performed,
- False if a problem occurs. HErrorInfo is used to identify the error.
<Data file>: Character string
Name of data file (defined in the analysis) for which the connection must be changed. This data file will be automatically closed in order for its connection to be modified.
If this parameter is set to "*", the process is applied to all known data files, regardless their origin (HFSQL, OLE DB, Native Connector, etc.).
This allows you to transform an HFSQL data file into an OLE DB data file for example.
This parameter can also correspond to the name of a group of files (or custom-folder) defined in the analysis (not available in Android and Android widget).
<New connection>: Character string or Connection variable
New connection to use. This parameter can correspond to:
- the name of the connection to a database. This connection has been defined in the data model editor or dynamically with HDescribeConnection. If this parameter corresponds to an empty string (""), the initial connection is automatically used.
- the name of the Connection variable that corresponds to the new connection to use.
- The connection must be known when running HChangeConnection. If the data file is not known when using HChangeConnection, the connection will be changed during the file declaration.
- HChangeConnection automatically closes the data file (HClose) whose connection must be modified.
- HChangeConnection does not open the data file or the connection. The connection defined with HChangeConnection will be used next time the data file is opened
Training (WINDEV): WD OLEDB
This page is also available for…