PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WEBDEV 24 feature!
  • This lesson will teach you the following concepts
  • Overview
  • Configuring the computers
  • The HFSQL Control Center
  • Creating a user account in the HFSQL Control Center
  • Make a backup copy of the database
  • Conclusion
Lesson 11.3. Managing a Client/Server database
This lesson will teach you the following concepts
  • The HFSQL Control Center.
  • Creating a user in the HFSQL Control Center.
  • Saving the database.

Estimated time: 20 mn
Previous LessonTable of contentsNext Lesson
Overview
Now that we know how to create and/or adapt a site so that it operates in HFSQL Client/Server mode, let's see how to manage the associated database.
Indeed, a Client/Server database requires:
  • a specific configuration of computers (setup of a HFSQL server, ...).
  • a management performed via the HFSQL Control Center.
Configuring the computers
To use a HFSQL Client/Server database, a HFSQL server must be installed on the server. Several HFSQL servers that use different ports can be installed on the same computer.
For example, a test HFSQL server that includes a test database and a production HFSQL server that is using a different port can be installed on the same computer.
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 perform all management operations on the HFSQL Client/Server servers and databases.
We are going to present the most important features.
First, we are going to start the HFSQL Control Center from the WEBDEV project.
  • To start the HFSQL Control Center from WEBDEV and to access the data:
    1. In the WEBDEV menu, on the "Tools" pane, in the "Database" group, click "HFSQL". The HFSQL Control Center is displayed.
    2. The home window of HFSQL Control Center is displayed. The analysis of current project is automatically selected.
    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 data files in HFSQL Client/Server format is displayed.
      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.
    5. To view the records in the data files, double-click one of the data files in the list on the left (for example, "Orders"). If the HFSQL Control Center does not recognize all connection parameters, a connection window is used to perform the effective connection to the HFSQL Client/Server server used. If this window is displayed, specify the password and validate.
    6. The information about the selected data file that is using this connection is displayed in a new tab:
    • The "Description" tab gives information about the data files (data file items, etc.).
    • The "Content" tab displays the records found 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 a HFSQL server and when creating a database: the administrator account. By default, the administrator has the login "Admin" and no password. Reminder: it is possible to customize the password when installing the HFSQL server.
Using a user account allows you to secure the access to data. Indeed, all the users of the site are not 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.
Do not confuse right management for the Client/Server databases with the user groupware, which we've seen in a previous lesson.
Some users may not have the rights to write into some data files for example. To run a simple test, we are going to create a user and allow this user to see the records in the Customer data file.
  • To directly connect to the database found on the server:
    1. Expand the menu found at the top left of HFSQL Control Center and select "Connect to a HFSQL server".
    2. The home window of HFSQL Control Center is displayed.
    3. The option "Connect to a HFSQL server" is selected by default. Specify the characteristics of the server installed in the previous lesson.
    4. The characteristics of HFSQL server are displayed in the different panels:
      • the name of HFSQL server as well as the list of databases found on this server are displayed in the left panel.
      • in the right section of the screen, a new tab allows you to see the characteristics of HFSQL server.
    5. In 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 time.
    7. To create a new user, in the ribbon, in the "Users" group, click the "New" button. The screen used to define the user characteristics is displayed.
    8. Type the following information:
      (use "Test" as password for example).

      Note

      Several characteristics can be noticed:
      • Super User: The users defined as "Super user" are allowed to perform all types of actions on the server, on the databases and on all the data files.
      • Account enabled: If this option is not checked, the user exists but he is not enabled (users on holiday for example).
      • Password expiration: You can specify a password valid for a limited number of days. (configurable).
    9. Validate the user creation. By default, no rights are granted to this user.
We are now going to 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" pane, in the "Rights" group, click "Management of 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.
    5. Click on "Apply" at the bottom of window (blue arrow). The rights become effective.
    6. Close the window for managing rights.
  • 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" pane, in the "Rights" group, click "Management of rights".
    3. Select the "Test" user in the list of users.
    4. In the list of rights, for the action named "Rights to read the records of a file", click the "Defined rights" column and select the green checkmark.
    5. Click on "Apply" at the bottom of window (blue arrow). The rights become effective.
    6. Close the window for managing rights.
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 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 by programming with the WLanguage functions. See Functions for HFSQL Client/Server management for more details.
Make 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 vertical tab named "Backups".
  3. In the menu, in the "Backups" group, expand "New backup" and select "New hot backup".
    Note: This button is accessible in the "Backups" group:
    • on the tab corresponding to the HFSQL server,
    • on the tab corresponding to the database.
  4. Validate the backup.
Conclusion
The HFSQL Control Center is a tool for managing databases, allowing you to:
  • stop or restart a server if a problem occurs,
  • manage the users and their rights,
  • reindex the data files if necessary,
  • perform 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.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 24
Comments
Click [Add] to post a comment