Base简介

出自OOo 中文指南手册翻译

跳转到: 导航, 搜索


这是OpenOffice.org 3.x 新手指南的第八篇,英文版是由OOoAuthors group制作的。OpenOffice.org的Documentation有本文英文版的PDF版本。

[编辑] 简介

数据源和数据库,都是一个信息流的集合,用户可以通过OpenOffice.org (OOo)办公套件对其进行访问和管理。例如,一个姓名和地址的清单就是一个数据源,可用于撰写一封群发邮件。通过OOo办公套件,一家商店的库存清单也可以作为一个数据源进行管理。

A data source, or database, is a collection of pieces of information that can be accessed or managed by OpenOffice.org (OOo). For example, a list of names and addresses is a data source that could be used for producing a mail merge letter. A shop stock list could be a data source managed through OOo.


Image:documentation_note.pngOpenOffice.org使用术语数据源数据库来指同样的对象,它可以是这样一个库,比如 MySQL、dBASE、电子表格或文本文件中保存的数据。
 

OpenOffice.org uses the terms "Data Source" and "Database" to refer to the same thing, which could be a database such as MySQL or dBase or a spreadsheet or text document holding data.



本章包括:创建数据库,演示数据库的构成以及各个构成在OOo办公套件中如何使用。它还包括如何使用利用OOo办公套件中的基本组件去注册其它的数据源。数据源可以是数据库,电子表格或文本文件。

This chapter covers creating a database, showing what is contained in a database and how the different parts are used by OOo. It also covers using the Base component of OOo to register other data sources. A data source can be a database, spreadsheet, or text document.

数据源只在本章中介绍。如需更多有关数据库使用的详细信息,请参阅数数据库指南(尚未撰写)

Data sources are only introduced in this chapter. For more detailed information about the use of databases, see the Database Guide (not yet written).

Image:documentation_note.pngOOo Base使用的是HSQL数据库引擎。由这个引擎创建的所有文件都保存在一个压缩文件。该数据库表单也包括在此表格压缩文件中。
 

OOo Base uses the HSQL database engine. All of the files created by this engine are kept in one zipped file. The database forms are included in this zipped file.


数据库由若干包含独立数据流的字段组成。数据库的每个表格都是一个字段的分组。创建表格后,你可以设定表格中的每个字段的特性。 表单用于与其关联的一个或多个表格的字段数据输入。它们也可以用于浏览与表单关联的一个或多个表格的字段。 基于创建的查询,一条查询将会产生一个源自既存表格的新表格。报表则会依照要求把查询中的字段的信息组织到文件中。

A database consists of a number of fields that contain the individual pieces of data. Each table of the database is a group of fields. When creating a table, you also determine the characteristics of each field in the table. Forms are for data entry into the fields of one or more tables associated with the form. They can also be used for viewing fields from one or more tables associated with the form. A query creates a new table from the existing tables based upon how you create the query. A report organizes the information of the fields of a query in a document according to your requirements.

Image:documentation_caution.pngOOo中的数据库需要Java Runtime Environment (JRE)。如果电脑上还没有,可以依照网站www.java.com上的介绍下载并安装。它应该是Java 5.0或更高。在OOo办公套件中,可以使用工具>选项>OpenOffice.org>Java来注册Java。 Windows版本不使用JRE时,可以选择其他版本。
 

The database in OOo requires Java Runtime Environment (JRE). If you do not have it on your computer, you can download it from www.java.com and install it following the instructions on the site. It should be Java 5.0 or higher. In OOo, use Tools > Options > OpenOffice.org > Java to register Java. Windows' version of JRE can not be used, while there are other versions that can.


Base可以创建关系数据库。这使得它很容易创建一个有关联字段的数据库。

Base creates relational databases. This makes it fairly easy to create a database in which the fields of the database have relationships with each other.

例如:分析一下一个关于图书馆的数据库。它有一个用于作者姓名的字段以及另外一个用于图书名称的字段。作者和他们所写的图书之间存在明显的关联。该图书馆可能包含了同一作者的多本图书。这就是一个一对多的关系:一个作者和多本图书。在这样一个数据库中,并非所有的关联都是一个一对多的关系。

For example: Consider a database for a library. It will contain a field for the names of the authors and another field for the names of the books. There is an obvious relationship between the authors and the books they have written. The library may contain more than one book by the same author. This is what is known as a one-to-many relationship: one author and more than one book. Most if not all the relationships in such a database are one-to-many relationships.

再分析一下这个图书馆的雇员数据库。其中的一个字段包含员工的姓名,而其他则包含社会安全号码和其他个人资料。姓名和社会安全号码之间的关系是一对一:一个社会安全号码仅对应一个姓名。

Consider an employment database for the same library. One of the fields contains the names of the employees while others contain the social security numbers, and other personal data. The relationship between the names and social security number is one-to-one: only one social security number for each name.

如果需要进行精确的设置,关系数据库就可以很容易做到,通过设定术语:元素,子集,并集,和交集。数据库中的字段即是元素。表格即是子集。关系定义,通过术语子集(表格)的合集与交集。

If you are acquainted with mathematical sets, a relational database can easily be explained in terms of sets: elements, subsets, unions, and intersections. The fields of a database are the elements. The tables are subsets. Relationships are defined in terms of unions and intersections of the subsets (tables).

为了解释如何使用数据库,我们将创建一个汽车费用数据库。在这个过程中,我们将解释数据库如何操作。

To explain how to use a database, we will create one for automobile expenses. In the process, we will be explaining how a atabase work.


[编辑] 相关链接

本文原文

个人工具