PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • This lesson will teach you the following concepts
  • Overview
  • Installing a local HFSQL server
  • Creating an application that is using a HFSQL Client/Server database
  • Adapting an application to use a HFSQL Client/Server database
  • Overview
  • Adapting the example
  • Features available in HFSQL Client/Server mode
Lesson 5.2. Implementing a Client/Server database
This lesson will teach you the following concepts
  • Installing a local HFSQL server.
  • Creating an application that is using a HFSQL Client/Server database.
  • Adapting an application to manage a HFSQL Client/Server database.
  • Features available in Client/Server mode.

Estimated time: 10 mn
Previous LessonTable of contentsNext Lesson
Overview
In this lesson, we are going to perform all operations required to develop and to deploy an application that is using a HFSQL Client/Server database.
Installing a local HFSQL server
The first operation to perform consists in installing a HFSQL server.
  • This server can be installed locally on the development computer (that's what we are going to do).
  • In deployment, this server can be installed on a specific computer.
The setup program of HFSQL server is available on the WINDEV DVD. If you do not own this DVD, the setup of HFSQL server is also available from our site (www.windev.com).
  • To install the HFSQL server locally:
    1. Start the WINDEV setup program.
    2. Choose "HFSQL Client/Server Setup".
    3. Then, select "Install or update a HFSQL Client/Server server".
    4. Accept the license agreement.
    5. Choose the platform ("For Windows on this computer").
    6. If HFSQL servers are already installed on the current computer, select "Install a new server".
    7. Select the setup directory and specify the server name and port. The port 4900 will be used by default.

      Note

      Don't forget to open this port on the firewall in order to connect to the HFSQL server from another computer.
    8. Install the HFSQL Control Center if it is not already present or accessible from your computer.

      Caution!

      The HFSQL Control Center is required to manage the HFSQL Client/Server database.
    9. The wizard proposes to configure the sending of notifications in order to identify the server dysfunctions in real time. In our example, go to the next step and indicate that the setting will be performed "Later".
    10. The wizard proposes to configure the authentication via Active Directory. In our example, go to the next step directly.
    11. Validate (or not) the participation in product improvement by allowing us to collect information regarding the use of product. This optional and anonymous collect allows PC SOFT to improve the product features.
    12. The setup is performed. By default, to connect to the server in administrator mode, use the "admin" user without password.

Note

For security reasons, don't forget to change the administrator password.
Creating an application that is using a HFSQL Client/Server database
Creating a WINDEV application that is using a HFSQL Client/Server database is child's play. You must:
  1. Create the project by asking to create a new database.
  2. Create the analysis by specifying that the databases used by the project will be "HFSQL Client/Server" databases.
  3. Specify the characteristics of the connection to the HFSQL Client/Server server that will be used.
  4. When creating a file in the analysis, indicate that this file is in Client/Server mode and specify the connection used.

Note

You can also describe the connection to the HFSQL server by programming. See the online help for more details: HDescribeConnection.
Adapting an application to use a HFSQL Client/Server database

Overview

Switching a database from HFSQL Classic mode to Client/Server mode is the most common operation.
WINDEV proposes several methods to perform this switch:
  • perform this adaptation in the data model editor.
  • perform this adaptation from the HFSQL Control Center.
To better understand the different steps, we are going to switch the application that was created in Part 3 to Client/Server mode by using the first method, the data model editor.

Adapting the example

Answer

If you did not perform the operations in the previous lessons, you can follow this lesson by opening a corrected project: on the "Home" pane, in the "Online help" group, expand "Tutorial" and select "Full application (Answer)".
  • To adapt the project:
    1. Open the "WD Full Application" project if necessary.
    2. In the project explorer, select (if necessary) the project configuration "Windows 32-bit executable".
    3. Load the analysis of your project in the data model editor: click among the quick access buttons. The data model editor is displayed.
    4. On the "Analysis" pane, in the "Connection" group, click "New connection". A wizard is opened, allowing you to create a connection.
    5. Select the type of connection to create: "HFSQL Client/Server".
    6. Go to the next step.
    7. In the following steps, specify:
      • the server name (name of your computer for example) and the port number. Go to the next step.
      • the user name and password (leave this information empty to use the administrator). Go to the next step.
      • the database name ("WD Full Application" in our example). Go to the next step.
    8. Type the connection name (keep the proposed name).
    9. Go to the next step and validate. The connection to the database is automatically created. The wizard proposes to associate the different data files found in the analysis with the connection that was just created.
    10. Click "Yes".
    11. In the next step, select all proposed files:
      Go to the next step.
    12. Then, the wizard proposes to copy the data files onto the server. Validate ("Copy now").
    13. Select the analysis files that will be copied onto the server: in our case, all data files found in the EXE directory.
    14. Go to the next step and validate.
    15. The data files found in the analysis are automatically transformed into HFSQL Client/Server data files and associated with the selected connection.
    16. Generate the analysis: on the "Analysis" pane, in the "Analysis" group, click "Generation". An automatic modification of data files is automatically performed. The automatic modification of data files can be canceled if all the data files are updated.

      Note

      Switching to Client/Server mode: tips
      • Check the code of your project: in HFSQL Client/Server mode, the HSubstDir statements, ... are useless
      • Depending on the parameters specified when creating the connection, the connection defined in the analysis can be modified by HOpenConnection and HChangeConnection.
      • HOpenConnection is used to go back to HFSQL Classic mode: all you have to do is specify the path of directory containing the HFSQL Classic data files.
    17. The development project was successfully adapted. You may also have to adapt the deployed application (if the deployed application is using HFSQL Classic files for example). This operation is configured when creating the setup program of the application.
Features available in HFSQL Client/Server mode
HFSQL Client/Server proposes several features:
These features will not be described here (some of them have been presented in this tutorial in HFSQL Classic mode).
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 23
Comments
Click [Add] to post a comment