ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Dynamically changes the connection associated with a table. The new connection must be known and defined during this change. This new connection will be used during the next opening of the table.
This allows you to import Oracle table descriptions into the database schema, and use them to work with HFSQL tables. For more details, see the detailed examples.
Tips:
// Describe the new connection
HDescribeConnection("MyConnection", "", "", " Server_SQLServer ", "dbo", hOledbSQLServer, hOReadWrite, "")
// Establish the new connection
HOpenConnection("MyConnection")
// Specify that "Salaries" uses the new connection
HChangeConnection("Salaries", "MyConnection")
// Start looping through the "Salaries" table on SQLServer
HReadFirst("Salaries")
...
// Close the connection
HCloseConnection("MyConnection")
// Restore the use of connection on Oracle
HChangeConnection("Salaries", "")
// Open the "Salaries" table on Oracle
HOpen("Salaries")
Syntax
<Result> = HChangeConnection(<Table> , <New connection>)
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HErrorInfo is used to identify the error.
<Table>: Character string
Name of table (defined in the database schema) for which the connection must be changed. This table 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 tables, regardless of their origin (HFSQL, OLE DB, Native Connector, etc.). This allows you to transform an HFSQL table into an OLE DB table for example.
    In projects with multiple database schemas, tables from different database schemas are taken into account.
  • This parameter can also correspond to the name of a group of files (or custom-folder) defined in the database schema (not available in Android and Android widget).
<New connection>: 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 is an empty string (""), the initial connection is automatically used.
  • the name of the Connection variable that corresponds to the new connection to use.
Remarks
  • The connection must be known when running HChangeConnection. If the table is not known when using HChangeConnection, the connection will be changed during the table declaration.
  • HChangeConnection automatically closes the table (HClose) whose connection must be modified.
  • HChangeConnection does not open the table or the connection. The connection defined with HChangeConnection will be used next time the table is opened
Component: wd310hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2026

Send a report | Local help