ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
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.
Tips:
Example
MyConnection is Connection
 
// Describe the connection
MyConnection.User = "USER"
MyConnection.Password = "PASSWORD"
MyConnection.Server = "MYSERVER"
MyConnection.Database = "Database"
MyConnection.Provider = hNativeAccessSQLServer
MyConnection.Access = hOReadWrite
 
// Open the connection
MyConnection.OpenConnection()
 
// Specify that "Salaries" uses the new connection
Salaries.ChangeConnection(MyConnection)
 
// Start looping through the "Salaries" table on SQLServer
Salaries.ReadFirst()
...
// Close the connection
MyConnection.CloseConnection()
 
// Restore the use of connection on Oracle
Salaries.ChangeConnection("")
 
// Open the "Salaries" table on Oracle
Salaries.Open()
Syntax
<Result> = <Source>.ChangeConnection(<New connection>)
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HErrorInfo is used to identify the error.
<Source>: Type corresponding to the specified source
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.
<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.
Remarks
  • The connection must be known when running <Source>.ChangeConnection. If the data file is not known when using <Source>.ChangeConnection, the connection will be changed during the file declaration.
  • <Source>.ChangeConnection automatically closes the data file (<Source>.Close) whose connection must be modified.
  • <Source>.ChangeConnection does not open the data file or the connection. The connection defined with <Source>.ChangeConnection will be used next time the data file is opened
Component: wd290hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/19/2024

Send a report | Local help