PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WEBDEV 28 feature!
  • In this lesson you will learn the following concepts
  • Overview
  • Installing a local HFSQL server
  • Creating a site that uses an HFSQL Client/Server database
  • Adapting a site to use an HFSQL Client/Server database
  • Overview
  • Adapting the example
  • Features available in HFSQL Client/Server mode
Lesson 11.2. Implementing a Client/Server database
In this lesson you will learn the following concepts
  • Installing a local HFSQL server.
  • Creating a site that uses an HFSQL Client/Server database.
  • Adapting a site to manage an HFSQL Client/Server database.
  • Features available in Client/Server mode.
Lesson duration

Estimated time: 10 mn
Previous LessonTable of contentsNext Lesson
Overview
In this lesson, we will perform all the operations required to develop and deploy a site that uses an HFSQL Client/Server database.
Installing a local HFSQL server
The first operation to perform consists in installing an HFSQL server.
This server can be installed locally on the development computer (that's what we are going to do). In the deployment phase, the server can be installed on a specific computer or directly on the server that hosts your site.
The HFSQL server setup program is included in the WINDEV, WEBDEV and WINDEV Mobile setup media. If you do not 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 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. 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.

    Note

    For security reasons, don't forget to change the administrator password.
  9. If the HFSQL Control Center is not installed or is not accessible from your computer, check the option "Install the HFSQL Control Center".

    Caution!

    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.
  13. 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.
Creating a site that uses an HFSQL Client/Server database
Creating a WEBDEV site that uses an HFSQL Client/Server database is very simple. You must:
  1. Create the project with 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 data file in the analysis, indicate that this data file is in Client/Server mode and specify the connection used.

Note

You can also define the connection to the HFSQL server programmatically. For more details, see the online help: "HDescribeConnection".
Adapting a site to use an HFSQL Client/Server database

Overview

Switching an HFSQL Classic database to Client/Server is the most common operation.
WEBDEV includes multiple solutions to perform this operation:
  • from the data model editor.
  • from the HFSQL Control Center.
To better understand the different steps, we are going to switch the site we created in part 4 to Client/Server using the analysis editor.

Adapting the example

  • We are going to adapt the "Full WEBDEV Site" project to use a Client/Server database.
  • If necessary, open the project you worked on in the previous lessons.
    1. Go to the WEBDEV home page (Ctrl + <).
    2. On the home page, click "Tutorial", then in "Parts 11 and 12", double-click "Full WEBDEV Site (Exercise)".
    3. A dialogue box prompts you to open the project you worked on in the previous lessons. You can open the local copy or the original project. Select "Open the local copy".

Answers

A corrected project is available. This project allows you to perform the different operations in this lesson. To open the corrected project, go to the home page and click "Tutorial", then in "Parts 11 and 12", double-click "Full WEBDEV Site (Answers)".
  • To adapt the project:
    1. Load the analysis of your project in the data model editor: click Load project analysis in the quick access buttons of the WEBDEV menu. The data model editor is displayed.
    2. In the ribbon, on the "Analysis" tab, in the "Connection" group, click "New connection". A wizard opens, allowing you to create a connection.
    3. Select the type of connection to create: "HFSQL Client/Server".
      Selecting the type of database
      Go to the next step.
    4. In the following steps, specify:
      Choose server
      • the name of the server on which the HFSQL Client/Server server was installed (localhost if it was installed on your computer, for example), and the port number.
      • the username and password (to use the administrator, specify the login credentials defined when the HFSQL server was installed).
      • the database name ("Full_WEBDEV_Site" in our example).
    5. Define the connection name (keep the default name).
    6. Go to the next step and validate. The connection to the database is automatically created. The wizard prompts you to associate the different data files in the analysis with the connection that has just been created.
      Associating data files with the connection
    7. Click "Yes".
    8. In the next step, select all the data files:
      Select data files
      Go to the next step.
    9. A dialog box prompts you to copy the data files to the server. Validate ("Copy now").
      Copy data files
    10. Select the analysis data files to be copied to the server: in our case, all data files in the EXE directory.
      Copy data files
    11. Go to the next step and validate.
    12. The data files in the analysis are automatically changed into HFSQL Client/Server data files and associated with the selected connection.
      Data model editor
    13. Generate the analysis: In the ribbon, 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.

      Note

      Switching to Client/Server mode: tips
      • Check the code of your project : in HFSQL Client/Server mode, HSubstDir and other similar statements 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.
    14. The development project was successfully adapted. You may also have to adapt the deployed site (if the deployed site uses HFSQL Classic data files, for example). This operation is configured when creating the site setup program.
Features available in HFSQL Client/Server mode
HFSQL Client/Server offers multiple 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 28
Comments
Click [Add] to post a comment