ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Example: Importing a file description from an existing data file
  • Example: Importing an HFSQL Client/Server file with password
  • Example: Connecting to the file of Groupware users
HDeclareExternal (Example)
Example: Importing a file description from an existing data file
Example: Importing an HFSQL Client/Server file with password
dsMyHotel is Data Source
New_connection is Connection
 
HPass(dsMyHotel, "Tahiti")
 
// Connection parameters
New_connection.Provider = hAccessHFClientServer
New_connection.User = "MyUser"
New_connection.Password = "MyPassword"
New_connection.Server = "MyServerIP"
New_connection.Database = "MyDatabase"
 
// Open the connection
IF NOT HOpenConnection(New_connection) THEN
Error("Connection error: ", HErrorInfo())
RETURN
END
IF NOT HDeclareExternal(".\Hotels.fic","dsMyHotel", New_connection) THEN
Error("Error on the external declaration: ", HErrorInfo())
RETURN
END
 
HReadFirst(dsMyHotel)
Info(dsMyHotel.Name)
Example: Connecting to the file of Groupware users
This example explains how to connect to the user file of User Groupware when this file is an HFSQL Client/Server file.
dsUSERGPW is Data Source
New_connection is Connection
 
// Connection parameters
New_connection.Provider = hAccessHFClientServer
New_connection.User = "my user"
New_connection.Password = "my password"
New_connection.Server = "my server"
New_connection.Database = "my database"
New_connection.Encryption = hEncryptionNO
 
// Open the connection
IF NOT HOpenConnection(New_connection) THEN
Error(HErrorInfo())
RETURN
END
 
HPass(dsUSERGPW, "PCSGPW2001")
IF NOT HDeclareExternal(".\Gpw_GPWU_HFCS\\USERGPW.fic", dsUSERGPW, New_connexion) THEN
Error(HErrorInfo())
RETURN
END
 
dsUSERGPW.login = "testman"
IF NOT HAdd("dsUSERGPW") THEN Error(HErrorInfo))
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/17/2023

Send a report | Local help