关系
此命令可打开关系设计窗口,可以在其中定义各种数据库表格之间的关系。
在此可以通过公用数据字段将当前数据库中的表格链接在一起。单击新建关系图标或只通过鼠标拖放操作来创建关系。
此功能仅适用于关系数据库。
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.
如果关系设计窗口处于打开状态,则即使在表格设计模式下也无法修改选定的表格。这样可以确保在创建关系的过程中表格不会被修改。
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.
主关键字指定的数据字段在表格窗口中用一个小的关键字图标标明。
定义关系
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.
另外,您也可以通过单击关系字段上方区域中的新建关系图标,在关系对话框中定义两个表格之间的关系。
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.
双击连接线打开关系对话框,可以在其中指定关系的某些属性。