Relations
Cette commande ouvre la fenêtre Ébauche de relation permettant de définir des relations entre différentes tables de base de données.
Dans cette fenêtre, vous pouvez lier entre elles des tables de la base de données active par l'intermédiaire de champs de données communs. Cliquez sur l'icône Nouvelle relation pour créer des relations ou effectuez un simple glisser-déposer avec la souris.
Cette fonction n'est disponible que si vous utilisez une base de données relationnelle.
When you choose Tools - Relationships, a window opens in which all the existing relationships between the tables of the current database are shown. If no relationships have been defined, or if you want to relate other tables of the database to each other, then click on the Add Tables icon. The Add Tables dialog opens in which you can select the tables with which to create a relation.
Si la fenêtre Ébauche de relation est ouverte, les tables sélectionnées ne peuvent pas être modifiées, même en mode Ébauche de table. Ceci empêche toute modification des tables lors de la création des relations.
The selected tables are shown in the top area of the relation design view. You can close a table window through the context menu or with the Delete key.
Primary key and foreign keys
If you want to define a relation among the various tables, you should enter a primary key that uniquely identifies a data field of an existing table. You can refer to the primary key from other tables to access the data of this table. All data fields referring to this primary key will be identified as a foreign key.
Les champs de données auxquels une clé primaire est assignée sont identifiés par un symbole représentant une clé dans la fenêtre de table.
Définir des relations
All existing relations are shown in the relations windows by a line that connects the primary and foreign key fields. You can add a relation by using drag-and-drop to drop the field of one table onto the field of the other table. A relation is removed again by selecting it and pressing the Delete key.
Vous pouvez aussi cliquer sur l'icône Nouvelle relation, dans la zone supérieure du champ de relation, et définir la relation entre deux tables dans la boîte de dialogue Relations.
If you use LibreOfficeDev as the front-end for a relational database, the creation and deletion of relationships is not placed in an intermediate memory by LibreOfficeDev, but is forwarded directly to the database.
En double-cliquant sur une ligne de connexion, vous pouvez assigner certaines propriétés à la relation. La boîte de dialogue Relations s'ouvre.