ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV 2024 feature!
Help / WINDEV Tutorial / Tutorial - Using an HFSQL Client/Server database
  • Lesson 1 - Implementing a Client/Server database
  • Overview
  • Installing a local HFSQL server
  • Adapting an application to use an HFSQL Client/Server database
  • Opening the example project
  • Adapting the project
  • To sum up
  • Further information

Tutorial - Using an HFSQL Client/Server database

Lesson 1 - Implementing a Client/Server database
We will cover the following topics:
  • Installing a local HFSQL server.
  • Creating an application that uses an HFSQL Client/Server database.
  • Adapting an application to support an HFSQL Client/Server database.
Durée de la leçon 10 min
Overview
WINDEV allows you to create applications that access an HFSQL Client/Server database.
The Client/Server mode lets you migrate databases to a server. This operating mode:
  • increases data security,
  • allows you to easily manage multiple users,
  • facilitates maintenance, etc.
In this tutorial, we will follow all the necessary steps to develop and deploy an application that uses an HFSQL Client/Server database.
To follow these steps, we will use the "WD Full Application" project. This lesson will explain how to install a local HFSQL server and adapt an application to use an HFSQL Client/Server database. In the next lesson, we will see how to manage a Client/Server database.
For more details on HFSQL Client/Server, see HFSQL Client/Server.
Installing a local HFSQL server
The first operation to perform consists in installing an HFSQL server.
This server can be installed on the development computer (that's what we are going to do). On the deployment side, the server can be installed on a specific computer.
The HFSQL server setup program is included in the WINDEV, WEBDEV and WINDEV Mobile setup media. If you don't have this media, the HFSQL server setup is also available on our site (www.windev.com).
To install the HFSQL server locally:
  1. Start the WINDEV/WEBDEV/WINDEV Mobile setup program.
  2. Select "Install HFSQL Client/Server".
  3. Then, select "Install or update an HFSQL server".
  4. Accept the license agreement.
  5. Select a platform ("For Windows on this computer").
  6. If there are HFSQL servers already installed on the current computer, select "Install a new server".
  7. Select the installation directory and specify the server name and port. The port 4900 will be used by default.
    Don't forget to open this port on the firewall in order to connect to the HFSQL server from another computer.
  8. Specify the login credentials of the user with administrator privileges that will be created by default on the HFSQL server. By default, this user is "Admin" and has no password.
    For security reasons, don't forget to change the administrator password.
  9. Install the HFSQL Control Center if it is not already installed or cannot be accessed from your computer.
    Warning
    The HFSQL Control Center is required to manage the HFSQL Client/Server database.
  10. The wizard prompts you to configure the sending of notifications to identify server problems in real time. In this case, go to the next step and indicate that the settings will be defined "Later".
  11. The wizard allows you to enable the Active Directory authentication. Enable this option if necessary.
  12. You can help us improve by allowing us to collect information regarding the use of our products. This optional and anonymous data collection allows PC SOFT to improve its products.
The installation is completed.
By default (if you have not changed the administrator settings), to connect to the server in administrator mode, you must use the "Admin" user without password.

Remark: In this tutorial, we explain how to adapt an existing application to Client/Server mode. However, once the HFSQL server has been installed, you can directly develop an application that uses HFSQL Client/Server data. The only difference with a project that uses HFSQL Classic data is the format of the data manipulated in the analysis: the databases used by the project are in "HFSQL Client/Server" mode.
For more details on how to create a WINDEV project and an analysis, see Creating a WINDEV project and its analysis.
Adapting an application to use an HFSQL Client/Server database
Switching an HFSQL Classic database to Client/Server is the most common operation.
WINDEV offers different methods to switch the database:
  • from the data model editor.
  • from the HFSQL Control Center.
To better understand the different steps, we are going to switch the WD Full Application project to Client/Server mode using the first method, the data model editor.

Opening the example project

This tutorial uses the "WD Full Application" project. To open this example:
  1. Go to the WINDEV home page (Ctrl + <).
  2. On the home page, click "Tutorial", then in "Tutorial - WINDEV Application: Manage data", double-click "Full application - Answers".
Warning
This project will be used in the different lessons of this tutorial.

Adapting the project

To adapt the "WD Full Application" project:
  1. In the "Project explorer" pane, select the "Windows 32-bit executable" configuration.
  2. Load the analysis of your project in the data model editor: click Load project analysis in the quick access buttons. The data model editor is displayed.
  3. On the "Analysis" tab, in the "Connection" group, click "New connection". A wizard opens, allowing you to create a connection.
  4. Select the type of connection to create: "HFSQL Client/Server".
    Type of connection to create
  5. Go to the next step.
  6. In the following steps, specify:
    Choose server
    • the server name (name of your computer for example) and the port number.
    • the username and password (leave these fields empty to log in as administrator) .
    • the database name (in this case, "WD Full Application").
    • the name of the connection (keep the default name).
  7. Go to the next step and validate. The connection to the database is automatically created. A dialog box prompts you to associate the different data files from the analysis with the connection that was just created.
    Associate files with the connection
  8. Click "Yes".
  9. In the next step, select all the data files:
    Select data files
    Go to the next step.
  10. A dialog box prompts you to copy the data files to the server. Validate ("Copy now").
  11. Select the analysis data files to be copied to the server: in our case, all data files in the "EXE\Windows 64-bit executable" directory.
    Warning
    There are two project configurations: 64-bit and 32-bit (required for the Express version).
    Be sure to select the 64-bit configuration files.
    If you are using the Express version, only the files from the 32-bit configuration must be selected.
    Data files to be associated with the connection
  12. Go to the next step and validate.
  13. The data files in the analysis are automatically changed into HFSQL Client/Server data files and associated with the selected connection.
    Data model editor
  14. Generate the analysis: on the "Analysis" tab, in the "Analysis" group, click "Generation". An automatic modification of the data files is automatically proposed. If all the data files are up to date, the automatic modification of the data files can be canceled.
    Switching to Client/Server mode: tips
    • Check the code of your project: in HFSQL Client/Server mode, HSubstDir and other similar functions have no effect.
    • You can modify the connection defined in the analysis with HOpenConnection and HChangeConnection according to the parameters specified when it was created.
    • HOpenConnection is used to go back to HFSQL Classic mode: simply specify the path of the directory containing the HFSQL Classic data files.
  15. The development project was successfully adapted. You may also have to adapt the deployed application (e.g., if the deployed application uses HFSQL Classic data files). This operation is configured when creating the setup program of the application. The steps to create the setup program are explained in lesson 3 of this tutorial.
To sum up
In this lesson, we saw how to install a local HFSQL server. We adapted a WINDEV project to use an HFSQL Client/Server database.
In the next lesson, we will see how to manage an HFSQL Client/Server database.
Further information
In this lesson, we saw how to adjust some settings in the application to use an HFSQL Client/Server database. HFSQL Client/Server offers many specific features that we won't cover in this tutorial:
Table of contentsNext Lesson
Minimum version required
  • Version 2024
Comments
Click [Add] to post a comment

Last update: 12/08/2023

Send a report | Local help