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 a site that is using a HFSQL Client/Server database
  • Adapting a site to use a HFSQL Client/Server database
  • Overview
  • Adapting the example
  • Features available in HFSQL Client/Server mode
Lesson 11.2. Implementing a Client/Server database
This lesson will teach you the following concepts
  • Installing a local HFSQL server
  • Creating a site that is using a HFSQL Client/Server database
  • Adapting a site 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 the operations required to develop and to deploy a site 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 or on the server that is hosting your site.
The setup program of the HFSQL server is available on the WEBDEV DVD. If you do not own this DVD, the setup of HFSQL server is also available from the our site (www.windev.com).
To install the HFSQL server locally:
  1. Start the setup program of WEBDEV.
  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. 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.
  11. 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 a site that is using a HFSQL Client/Server database
Creating a WEBDEV site 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 a site to use a HFSQL Client/Server database

Overview

Switching a database from HFSQL Classic mode to Client/Server mode is the most common operation.
WEBDEV propose several solutions to perform this adaptation:
  • 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 site that was created in part 4 of this tutorial 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 WEBDEV site (Answer)"
  • To adapt the project:
    1. Open the "Full_WEBDEV_Site" project if necessary.
    2. Load the analysis of your project in the data model editor: Click among the quick access buttons of WEBDEV menu. The data model editor is displayed.
    3. In the ribbon, on the "Analysis" pane, in the "Connection" group, click "New connection". A wizard is opened, allowing you to create a connection.
    4. Select the type of connection to create: "HFSQL Client/Server". Go to the next step.
    5. In the following steps, specify:
      • 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. Go to the next screen.
      • the user name and password (leave this information empty to use the administrator). Go to the next screen.
      • the database name ("Full_WEBDEV_Site" in our example). Go to the next screen.
    6. Type the connection name (keep the proposed name).
    7. 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.
    8. Click "Yes".
    9. In the next screen, select all proposed files:
      Go to the next step.
    10. Then, the wizard proposes to copy the data files onto the server. Validate ("Copy now").
    11. Select the analysis files that will be copied onto the server: in our case, all data files found in the EXE directory.
    12. Go to the next step and validate.
    13. The data files found in the analysis are automatically changed into HFSQL Client/Server data files and associated with the selected connection.
    14. 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.
    15. The development project was successfully adapted. You may also have to adapt the deployed site (if the deployed site is using HFSQL Classic files for example). This operation is configured when creating the setup program of the site.
Features available in HFSQL Client/Server mode
HFSQL Client/Server proposes several features:
  • Transactions,
  • Logs,
  • Stored procedures,
  • Triggers,
  • Hot automatic data modification,
  • Hot reindexing,
  • Scheduled backups,
  • Incremential backups,
  • Universal replication.
These features will not be described here (some of them have been presented in this tutorial in HFSQL Classic mode). See the online help for more details.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 23
Comments
Click [Add] to post a comment