PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Connection with a HFSQL analysis
  • Various
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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.
Versions 16 and later
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). See Accessing a database in local mode (SQLite) for more details.
New in version 16
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). See Accessing a database in local mode (SQLite) for more details.
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code The SQL functions are used to handle the local databases (such as Web SQL databases). See Accessing a database in local mode (SQLite) for more details.
Versions 19 and later
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
New in version 19
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5
// Example associated with the SALESMGT analysis
// TABLE_QryTable is a memory table
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 QueriesAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5

Connection with a HFSQL analysis

During a connection with a HFSQL analysis, SQLDisconnect closes the analysis (equivalent to HCloseAnalysis). To continue to use the analysis files, the analysis must be opened by HOpenAnalysis.
Note: From version 19, HFSQL is the new name of HyperFileSQL.

Various

  • A single connection can be established at a given time.
  • The memory allocated during the connection (execution of "SQLFreeConnect") is automatically freed.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Example with SQLConnect/SQLExec/SQLDisconnect
ConnectionNum is int
SourceName is string
// Connection to a specific data source via ODBC MS ACCESS
SourceName = "MS Access 97 Database"
ConnectionNum = SQLConnect(SourceName, "", "", "", "ODBC") // <--------
IF ConnectionNum <> 0 THEN
// The connection was successful

// Run the query and retrieve the result line by line
i is int = 0
SQLExec("SELECT LASTNAME, FIRSTNAME, EXTENSION, PHOTO FROM CUSTOMER", "QRY1") // <--------
WHILE SQLFetch("QRY1") = 0 // There is still another line to read
i++
// Retrieve the data
LASTNAME[i] = SQLGetCol("QRY1", 1)
FIRSTNAME[i] = SQLGetCol("QRY1", 2)
EXTENSION[i] = SQLGetCol("QRY1", 3)
{"IMAGE"+i} = SQLGetMemo("QRY1", 4)
END
SQLClose("QRY1")

ELSE
// The connection failed: display an error message
SQLInfo()
Error("The connection to the data source " + SourceName + " failed." + CR + ...
"Error code: " + SQL.Error + CR + SQL.MesError)

END
// In any case (connection OK or not)
SQLDisconnect() // <--------
BOLLER
Sep. 11 2018