ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / SQL functions
  • HFSQL analysis connection
  • Miscellaneous
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
Closes the current connection and frees the memory used by the connection. SQLDisconnect must be systematically called to close the connection, even if this connection failed.
PHP There is no need to use SQLDisconnect in the following cases
  • if no session is used.
  • if the connection failed.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). For more details, see Accessing a database in local mode (SQLite).
Example
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5
// Example associated with the SALESMGT analysis
// TABLE_QryTable is a Table control populated programmatically
ResConnect is int
ResExec is boolean
MyDatabase is string = "C:\SALESMGT.WDD"
ResConnect = SQLConnect(MyDatabase, "", "")
IF ResConnect <> 0 THEN
ResExec = SQLExec("SELECT NAME, CITY FROM POP", "QRY1")
IF ResExec = True THEN
// Retrieve the data in the table
SQLTable("QRY1", TABLE_QryTable)
ELSE
// Error while running the query
// Retrieve information about the query run
SQLInfo("QRY1")
Error(SQL.MesError)
END
// Free the query in any case
SQLClose("QRY1")
ELSE
 // Connection error
 Error("The connection to the database" + MyDatabase + " failed")
END
// Free the query in any case
SQLDisconnect()
Syntax
SQLDisconnect()
Remarks
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5

HFSQL analysis connection

In a connection with an HFSQL analysis, SQLDisconnect closes the analysis (same as HCloseAnalysis). To continue to use the analysis files, the analysis must be opened by HOpenAnalysis.

Miscellaneous

  • A single connection can be established at a given time.
  • The memory allocated during the connection (execution of "SQLFreeConnect") is automatically freed.
Component: wd290hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo de conexão em outra porta do Postgresql
nDBConnection = SQLConnect(sServerIP,sUser,sPassword,sDBName,"PostgreSQL","","Server Port = 15433")
Boller
12 Apr. 2023

Last update: 07/06/2023

Send a report | Local help