ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WEBDEV 28 feature!
  • In this lesson you will learn the following concepts
  • Overview
  • Configuring the computers
  • The HFSQL Control Center
  • Creating a user account in the HFSQL Control Center
  • Making a backup copy of the database
  • Conclusion
Lesson 11.3. Managing a Client/Server database
In this lesson you will learn the following concepts
  • The HFSQL Control Center.
  • Creating a user in the HFSQL Control Center.
  • Making a backup copy of the database.
Lesson duration

Estimated time: 20 mn
Previous LessonTable of contentsNext Lesson
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 WEBDEV project.
  • To open 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 screen. 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).

Caution!

The user rights specified in the HFSQL Control Center are granted for the database and not for accessing the site.
The permissions granted for the Client/Server databases should not be confused with the User Groupware, which we saw in a previous lesson.
Some users may not have rights to write to some data files, for example. To do a simple test, we will create a user and allow the user to see the records in the Customer data file.
  • To directly connect to the 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 in different panels:
      • 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
    5. On the right section of the screen, select the "Users" tab. This tab is used to manage the server users.
    6. Only the "Admin" user exists at this point.
      Management of users
    7. To create a new user, in the ribbon, in the "Users" group, click "New". The user properties window opens.
    8. Enter the following information:
      User properties
      (use "Test" as password for example).

      Note

      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).
    9. Validate the user creation. By default, no rights are granted to this user.
We will grant rights to the user: the "Test" user can 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.
Similarly, rights can be defined:
  • on the HFSQL server,
  • on the database,
  • on the database files.
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).
Once the account is created, it can be used when the application connects to the server (when HOpenConnection is used).

Note

The users and their rights can also be managed through programming with the WLanguage functions. For more details, see HFSQL Client/Server management functions.
Making a backup copy of the database
To make a backup copy of the database:
  1. Go to the tab corresponding to the "Full_WEBDEV_Site" database.
  2. Select the "Backups" tab on the left.
  3. In the menu, in the "Backups" group, expand "New backup" and select "New hot backup".
    Remark: This option is available in the "Backups" group:
    • on the tab corresponding to the HFSQL server,
    • on the tab corresponding to the database.
      Creating a backup
  4. Validate the backup.
Conclusion
The HFSQL Control Center is a complete database management tool that allows you 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 managed by the database administrator.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 28
Comments
Click [Add] to post a comment