PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example: Importing a file description from an existing data file
  • Example: Importing a HFSQL Client/Server file with password
  • Example: Importing a file description from an existing data file
  • Example: Connecting to the file of Groupware users
HDeclareExternal (Example)
Example: Importing a file description from an existing data file
Example: Importing a 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: Importing a file description from an existing data file
Windows Mobile
The following example allows you to use the "\AnExample\CUSTOMER.FIC" file in the current application. This data file is described in the "Example" application. It is imported into the current application as "CustomerWD". Its structure is automatically imported into the analysis of the current project. This allows you to add a record into this data file for example.
CustomerWD is Data Source
// Imports the description of CUSTOMER file as CustomerWD
HDeclareExternal("C:\AnExample\CUSTOMER.FIC", "CustomerWD")

// Add a record
CustomerWD.Name = "Montgomery"
...
HAdd(CustomerWD)

// Closes the file
HClose(CustomerWD)

// The description is not required anymore
HCancelDeclaration(CustomerWD)
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 a 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..CryptMethod = hCryptNo

// 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