ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WEBDEV 2024 feature!
Help / WEBDEV Tutorial / Tutorial - Managing an HFSQL Client/Server database
  • Lesson 2 - Managing a Client/Server database
  • Overview
  • Configuring the computers
  • The HFSQL Control Center
  • Starting the HFSQL Control Center
  • Creating a user account in the HFSQL Control Center
  • Connecting to the HFSQL Client/Server database
  • Creating a user
  • Defining the rights of the new user
  • To sum up

Tutorial - Managing an HFSQL Client/Server database

Lesson 2 - Managing a Client/Server database
We will cover the following topics:
  • The HFSQL Control Center.
  • Creating a user in the HFSQL Control Center.
  • Making a backup copy of the database.
Durée de la leçon 20 mn
Overview
Now that we know how to create and/or adapt a site for HFSQL Client/Server, we will see how to manage its database.
A Client/Server database requires:
  • a specific configuration on the computers (install an HFSQL server, etc.).
  • management via the HFSQL Control Center.
Configuring the computers
To use an HFSQL Client/Server database, an HFSQL server must be installed on the server. Several HFSQL servers that use different ports can be installed on the same computer.
For example, it is possible to install a test HFSQL server (with a test database) and a production HFSQL server on the same computer, using a different port.
However, for performance reasons, this configuration is not recommended. One or more databases can be installed on each server.
The HFSQL Control Center
The HFSQL Control Center is used to fully manage HFSQL Client/Server databases and servers.
We will present the most important features.
First, we will open the HFSQL Control Center from the "Full WEBDEV Site" project that we used in the previous lesson.
Warning
All the actions from the previous lesson must have been completed to perform the actions on the "Full WEBDEV Site" project in this lesson.

Starting the HFSQL Control Center

To open the HFSQL Control Center from WEBDEV and access the data:
  1. In the WEBDEV menu, on the "Tools" tab, in the "Database" group, click "HFSQL". The HFSQL Control Center is displayed.
  2. The HFSQL Control Center home window appears. The analysis of the current project is automatically selected.
    HFSQL Control Center home window
  3. Validate. The HFSQL Control Center is displayed. This start mode allows you to see the different data files linked to the analysis of the current project.
  4. Click the vertical tab named "HFSQL C/S" if necessary. The list of HFSQL Client/Server data files appears.
    HFSQL Control Center
    The Control Center lists the Client/Server data files found in the analysis linked to the current project. No connection is established: the names of the data files are grayed out.
  5. To view the records in the data files, double-click one of the data files in the list on the left (for example, "Order"). If the HFSQL Control Center does not recognize all the connection parameters, a window will allow you to establish the connection with the HFSQL Client/Server server used. If this window is displayed, specify the password and validate.
  6. The information of the selected data file that uses this connection is displayed in a new "Order" tab. This information is available in several vertical tabs:
    Information about a data file
  • The "Description" tab shows information about the data files (data file items, etc.).
  • The "Content" tab shows the records in the data files.
The entire HFSQL Client/Server database can be managed from the HFSQL Control Center.
Creating a user account in the HFSQL Control Center
A single user account is created when installing an HFSQL server and creating a database: the administrator account. By default, the administrator can use "Admin" as username and leave the password empty. Reminder: the password can be set when installing the HFSQL server.
User accounts enable secure access to data. Not all the users of the site are administrators. Specific rights can be granted to each user (or group of users). Some users may not have rights to write to some data files, for example.
Warning
The user rights specified in the HFSQL Control Center are granted for the database and not for accessing the site: The management of rights of Client/Server databases should not be confused with the User Groupware.
To do a simple test, we will create a user and allow the user to see the records in the Customer data file. We are going to:
  • Connect to the database on the HFSQL server.
  • Create a user.
  • Grand different permissions to the user.

Connecting to the HFSQL Client/Server database

To directly connect to the Full WEBDEV Site database on the server:
  1. Expand the HFSQL Control Center menu menu at the top left of the HFSQL Control Center and select "Connect to an HFSQL server".
  2. The HFSQL Control Center home window appears.
    HFSQL Control Center home window
  3. The option "Connect to an HFSQL server" is selected by default. Specify the characteristics of the server installed in the previous lesson.
  4. The characteristics of the HFSQL server are displayed.
Let's take a closer look at the information displayed:
  • the name of the HFSQL server and the list of databases are displayed in the left panel.
  • in the right section of the screen, a new tab appears and shows the characteristics of the HFSQL server.
    Server characteristics

Creating a user

To create a new user:
  1. On the right section of the screen, select the "Users" tab. This tab is used to manage the users of the server.
    Only the "Admin" user exists at this point.
    User management
  2. In the menu, in the "Users" group, click "New". The window used to define the user characteristics is displayed.
  3. Enter the following information:
    User properties
    (use "Test" as password for example).
    Several characteristics can be observed:
    • Superuser: Users defined as "Superusers" are allowed to perform all actions on the server, databases and data files.
    • Account enabled: If this option is not checked, the user is created but is not enabled (users on leave, for example).
    • Password expiration: You can specify a password valid only for a given number of days (configurable).
  4. Validate the user creation. By default, no rights are granted to this user.

Defining the rights of the new user

We will grant rights to the user: the "Test" user should be able to connect to the database and read the Customer data file.
To grant rights to connect to the database:
  1. In the HFSQL Control Center, double-click the "Full_WEBDEV_Site" database. A new tab appears.
  2. On the "Full_WEBDEV_Site" tab, in the "Rights" group, click "Manage rights".
  3. Select the "Test" user in the list of users.
  4. In the list of rights, for the action named "Rights to connect to the server (encrypted and unencrypted connection)", click in the "Defined rights" column and select the green checkmark.
    Rights management
  5. Click "Apply" at the bottom of the window. The rights become effective.
  6. Close the rights management window.
To grant rights to read the Customer data file:
  1. In the HFSQL Control Center, expand the "Full_WEBDEV_Site" database, and then double-click the Customer data file (on the left of the screen).
  2. On the "Customer" tab, in the "Rights" group, click "Manage rights".
  3. Select the "Test" user in the list of users.
    Rights management
  4. In the list of rights, for the action named "Rights to read the records of a file", click in the "Defined rights" column and select the green checkmark.
  5. Click "Apply" at the bottom of the window. The rights become effective.
  6. Close the rights management window.
Rights can be defined:
  • on the HFSQL server,
  • on the database,
  • on the database files.
Once the account has been created, it can be used when the application connects to the server using HOpenConnection.
In our example, the "Test" user can only browse through the records in the Customer data file. If this user tries to perform another action, a message will be displayed: "The Test user has no sufficient rights to XXXX" (where XXXX corresponds to the action performed).
To sum up
We have seen the basics of the HFSQL Control Center. This database management program can also be used to:
  • stop or restart a server if a problem occurs,
  • manage users and rights,
  • reindex data files if necessary,
  • create database backups.
The HFSQL Control Center is a redistributable tool that can be installed on the computers of users who are working with HFSQL Client/Server databases. The HFSQL Control Center must be used by the database administrator.
Further information:
Previous LessonTable of contents
Minimum version required
  • Version 2024
Comments
Click [Add] to post a comment

Last update: 12/08/2023

Send a report | Local help