ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Syntax 1: Opening a preset connection: automatic management of connections
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
Opens a connection to a specific database. The connection remains opened until the call to <Connection variable>.CloseConnection. <Connection variable>.OpenConnection is used to open a connection defined with a Connection variable. Caution: The order in which the functions for connecting to an HFSQL Client/Server database are called is important. For more details, see Optimizing the connection times to the HFSQL Client/Server databases.
Example
WindowsLinuxAjaxHFSQL ClassicHFSQL Client/ServerOLE DBNative Connectors (Native Accesses)
MyConnection is Connection
// Describe the connection
MyConnection.User = "USER"
MyConnection.Password = "PASSWORD"
MyConnection.Server = "MYSERVER"
MyConnection.Database = "Database"
MyConnection.Provider = hAccessHFClientServer
MyConnection.Access = hOReadWrite
MyConnection.ExtendedInfo = "Extended information"
MyConnection.CursorOptions = hClientCursor
 
MyConnection.OpenConnection()
Syntax
<Result> = <Connection>.OpenConnection()
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred (during a connection described through programming, some parameters used in HDescribeConnection may be incorrect for example).
HErrorInfo is used to identify the error.
<Connection>: Connection variable
Name of the Connection variable that describes the connection to a database.
Remarks
WEBDEV - Server codePHPAjaxHFSQL ClassicHFSQL Client/ServerOLE DBNative Connectors (Native Accesses)

Syntax 1: Opening a preset connection: automatic management of connections

  • The connection associated with a data file is automatically opened when the data file is opened. The connection is closed when the last data file that uses this connection is closed.
  • Any connection opened by <Connection variable>.OpenConnection remains open even if no data file uses it.
  • If the application opens and closes data files many times in a row, the automatic management of connections will open/close connections many times, slowing down the application. In this case, it is recommended to use <Connection variable>.OpenConnection to keep the connection open.
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