1. Trang chủ
  2. » Công Nghệ Thông Tin

Visibooks the visibooks guide to base 2 0 apr 2006 ISBN 1597060380 pdf

162 83 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 162
Dung lượng 11,23 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

On the Menu Bar, click File, then Close to return to the database window... On the Menu Bar, click File, then Close to return to the database window... When the Report Wizard window ap

Trang 2

The Visibooks Guide

to Base 2.0

by Jill & Kevin Jordan

Trang 3

The Visibooks Guide to Base 2.0

Copyright

Copyright © 2006 by Visibooks™, LLC All rights reserved

Trademarks and Disclaimer

Visibooks™ is a trademark of Visibooks, LLC All brand and product names in this book are trademarks or registered trademarks of their respective companies

Visibooks™ makes every effort to ensure that the information in this book is accurate However, Visibooks™ makes no warranty, expressed or implied, with respect to the accuracy, quality, reliability, or freedom from error of this document or the products described in it Visibooks™ makes no representation or warranty with respect to this book’s contents, and specifically disclaims any implied warranties or fitness for any particular purpose Visibooks™ disclaims all liability for any direct, indirect,

consequential, incidental, exemplary, or special damages resulting from the use of the information in this document or from the use of any products described in it Mention of any product does not constitute an endorsement of that product by Visibooks™ Data used in examples are intended to be fictional Any resemblance to real companies, people, or organizations is entirely coincidental

ISBN 1597060380

Trang 4

Table of Contents

Database Basics 1

Create a new database 2

Create tables 12

Create records 21

Create forms 29

Create queries 42

Create reports 49

Working with Tables 65

Modify tables 66

Create new tables 76

Specify data types 79

Specify field properties 85

Edit records 88

Find records 91

Sort and filter records 96

Create table relationships 101

Trang 5

TABLE OF CONTENTS

ii

Working with Forms 113

Modify forms 114

Add/delete records 119

Edit records 121

Find records 123

Filter records 126

Working with Queries 131

Create queries 132

Sort results 141

Add criteria 143

Employ Boolean operators 146

Trang 6

Database Basics

In this section, you’ll learn how to:

Create a new database

Trang 7

DATABASE BASICS

2

Create a new database

1 Start OpenOffice.org Base

Your screen should look like this:

Trang 8

2 In the Database Wizard window, click Create a new database

Then click the button

Trang 9

DATABASE BASICS

4

3 When the Save as window appears, create a new folder in the

My Documents folder called Practice Base Files

Tip: To create a new folder, make sure the My Documents

4 Double-click the Practice Base Files folder

It should appear as the Save In folder

Trang 10

5 In the File name box, type:

Family.odb

Tip: Base will automatically add a file extension for you when

Trang 11

DATABASE BASICS

6

6 Click the button

The window for the Family database should open:

Trang 12

Identify database elements

Elements of databases

A database stores information in an organized way, and makes it easy

to get information in and out

Tables store data within the database

Forms make it easy to put data into tables

Queries pull out specific data

Reports put data in an easily-read format

Table

Query

Report Form

Table

Trang 13

DATABASE BASICS

8

1 In the Database list, click Tables

Trang 14

2 Click Queries

Trang 15

DATABASE BASICS

10

3 Click Forms

Trang 16

4 Click Reports

5 Click Tables

Trang 18

A blank table should open with the columns Field Name, Field

Type, and Description:

Trang 19

DATABASE BASICS

14

Name fields in Design View

1 Click in the box under the Field Name column header:

2 Type:

First Name

Trang 20

3 Press the ENTER key on your keyboard

The Design View of the table should look like this:

The field type for First Name can stay Text [VARCHAR]

Trang 21

It should look like this:

5 Press the ENTER key on your keyboard

Trang 22

6 In the same way, create the following fields:

City Zip Phone Number

The table should now look like this:

Trang 23

DATABASE BASICS

18

7 On the Menu Bar, click File, then Save

8 When the Save As window appears, type:

My Family

in the Table Name box

9 Click the button

Trang 24

10 When the alert window that reads No primary key appears, click

the button

Base will insert an ID field—the Key field—in the table:

Trang 25

DATABASE BASICS

20

11 On the Menu Bar, click File, then Close

The key field

When the alert window popped up, and you clicked the button,

Base added the ID field to the table

The ID field is now the table’s primary key, or key field That means it

can’t contain any duplicates

Every table should have a key field

For example, if a hospital keeps a database, each patient can have a unique ID number in the key field

That way, if it has more than one patient named John Baker, it can

easily distinguish John Baker, ID #326 in for a checkup, from John

Baker, ID #298 who needs his gall bladder removed

Trang 26

Create records

1 Double-click the table My Family in the Tables list

2 Click in the box under the ID column header

3 Type:

1

Trang 27

6 Press the TAB key on your keyboard

The table should now look like this:

Trang 28

then press TAB

The table should now look like this:

Tip: Notice how the cursor in the row selector has moved down

to the second (new) record

When you move on to a new record, Base automatically saves the previous record

Trang 29

DATABASE BASICS

24

Add new fields

1 On the Menu Bar, click File, then Close

2 Right-click the My Family table

Trang 30

3 When the menu appears, click Edit

The table should appear in Design View:

Trang 31

DATABASE BASICS

26

4 Click the box under Phone Number and type:

State

5 Press the ENTER key

6 On the Menu Bar, click File, then Save

7 On the Menu Bar, click File, then Close

Trang 32

8 Double-click the My Family table

9 Click inside the new State field for the first record

10 Type:

MD

Trang 33

DATABASE BASICS

28

11 Press TAB until the cursor moves down to a new record

Record number 1 is saved and complete

12 On the Menu Bar, click File, then Close

Trang 34

Create forms

1 In the Database list, click Forms

Trang 35

DATABASE BASICS

30

2 Click Use Wizard to Create Form

Trang 36

3 When the Form Wizard window appears, click the button

All the table fields should be added to the form:

4 Click the button

Trang 37

DATABASE BASICS

32

5 When the next screen appears, leave Add Subform unselected

and click the button

Trang 38

6 When the next screen appears, make sure Columnar – Labels

on Top is selected

Trang 39

DATABASE BASICS

34

Then click the button three times

Trang 40

7 When the Set the name of the form screen appears, type:

My Family Data Input Form

in the box

Trang 41

DATABASE BASICS

36

8 Click the button

The form should open and look like this:

Trang 42

Add a new record

1 In the form window, click the button

A blank record should appear:

Trang 46

10 Press the TAB key again

The form should progress to a new, blank record:

The old record has been saved

11 On the Menu Bar, click File, then Close to return to the database

window

Trang 47

A query is a way to get specific information from the database

Essentially, it’s a question You use queries to ask the database things like, “Who are my customers in Montana?”, or “How many pipe fittings have I sold this month?”

Trang 48

2 Click Use Wizard to Create Query

Trang 49

DATABASE BASICS

44

3 When the Query Wizard opens, double-click My Family.First

Name in the Available Fields list

My Family.First Name should appear in the Fields in the Query column:

Trang 50

4 Click the button

This should add the Last Name field to the Fields in the Query

list:

5 Double-click My Family.Phone Number

Trang 52

7 When the Overview screen appears, in the Name of the query

box type:

Names and Numbers

8 Click the button

The query is automatically saved and executed

It should look like this:

Trang 53

DATABASE BASICS

48

9 On the Menu Bar, click File, then Close to return to the database

window

Trang 54

Create reports

1 In the Database list, click Reports

Trang 55

DATABASE BASICS

50

2 Click Use Wizard to Create Report

3 When the Report Wizard window appears, click the Tables or

Queries drop-down arrow

When the list appears, click Table: My Family

Trang 56

4 Click the button to move all the fields into the Fields in

report list

Trang 57

DATABASE BASICS

52

5 In the Fields in report list box, click ID, then click the button

The ID field should be removed

The report wizard should now look like this:

6 Click the button

Trang 58

7 When the Labeling fields screen appears, click the

button

Trang 59

DATABASE BASICS

54

8 When the Grouping screen appears, click the button

Trang 60

9 When the Sort options screen appears, click the Sort by

drop-down arrow

Then click State in the list

10 Click the button

Trang 61

DATABASE BASICS

56

Choose layout and style

1 When the Choose layout screen appears, make sure Default is

selected in the Layout of data section

Then click the button

Tip: The Layout of data section allows you to customize the look and feel of your reports You can click through the different layouts and see them applied to your report in the background

Trang 62

View the report

1 When the Create report screen appears, make sure the Title of

report box reads:

My Family

Make sure the Create report now radio button is selected

Trang 63

DATABASE BASICS

58

2 Click the button

The report is automatically created, saved and opened

It should look like this:

3 On the Menu Bar, click File, then Close to return to the Family

database window

4 On the Menu Bar, click File, then Save to save the Family

database

Trang 64

5 On the Menu Bar, click File, then Exit to close Base

Trang 65

DATABASE BASICS

60

Practice: Database Basics

1 Open OpenOffice.org Base

2 Create a blank database in the Practice Base Files folder called

Library.odb

3 Create a new table with these fields:

ID Title Author Genre Date Purchased Number of Pages

4 Save the table as Books

Allow Base to create a Primary Key

5 Rename the ID field (the Primary Key) Book ID

Trang 66

6 Enter these data into the table to create the first record:

Title: Ideas & Opinions Author: Albert Einstein Genre: Nonfiction Date purchased: 11/18/2005 Number of Pages: 384

It should look like this:

7 Close the Books table

8 Create a form for the Books table

Trang 67

DATABASE BASICS

62

9 Save it as Books Table Data Input

It should look like this:

Use the form to enter information for four more books

Tip: Feel free to make things up

10 Create a query that pulls out this information:

Title Genre Number of Pages

Trang 68

11 Save the query as Quick Book Notes

12 Run the query

It should look like this:

13 Create a report based on the Books table

14 Include all the fields of the Books table in the report, and sort the

records based on Genre

Tip: Format the report using the Default style

Trang 69

DATABASE BASICS

64

15 Name the report Book Inventory

It should look like this:

16 Close the report

17 Exit OpenOffice.org Base

Trang 70

Working with Tables

In this section, you’ll learn how to:

Modify tables

Create new tables

Specify data types

Specify field properties

Edit records

Find records

Sort and filter records

Create table relationships

Trang 71

WORKING WITH TABLES

66

Modify tables

1 Open a web browser and go to:

www.visibooks.com/books/base2

2 Right-click the FlowerStore.odb link

When the menu appears, click Save Link Target As

Trang 72

3 When the Save As window appears, open the Practice Base

Files folder on your hard drive

Then click the button

4 Wait for the database to download completely, then close the

web browser

Trang 73

WORKING WITH TABLES

68

Open an existing database

1 Start Base

2 When the Database Wizard opens, click the Open an existing

database file radio button

Trang 74

3 Click the button

Trang 75

WORKING WITH TABLES

70

4 Open the Practice Base Files folder, then double-click

FlowerStore.odb

Trang 76

The FlowerStore database window should now look like this:

Trang 77

WORKING WITH TABLES

72

Adjust table layout

1 Double-click the Customers table to open it

Trang 78

2 Place your cursor on the divider between the Phone Number

and Fax Number column headings

The cursor should turn into a double-headed arrow:

Trang 79

WORKING WITH TABLES

74

3 Double-click

The Phone Number column should resize to fit the widest piece

of data in that field:

Tip: Instead of double-clicking, you can also drag column heading dividers to set column widths manually

Trang 80

4 Double-click the divider between the City and State column

headings

The City field should resize to fit the data in it

5 Click the window’s button to close the Customers table

Trang 81

WORKING WITH TABLES

76

Create new tables

1 Click Create Table in Design view

A blank table will open in Design View:

Trang 82

2 In the first box in the Field Name column, type:

Order ID

then press the TAB key

It should look like this:

3 On the Toolbar, click the icon

Trang 83

WORKING WITH TABLES

78

4 When the Save As window appears, type:

Orders

in the Table Name box

5 Click the button

6 When the alert window appears, click the button

Tip: You’ll assign a Primary Key later

Trang 84

Specify data types

Assign the AutoNumber data type

1 In the Data Type column beside the Order ID field, click the

drop-down arrow

When the list appears, click Integer

2 Under Field Properties, beside the AutoValue field, click the

drop-down arrow

When the list appears, click Yes

Trang 85

WORKING WITH TABLES

80

3 In the Description column, type:

This is the Generic Order ID Number

then press TAB

Tip: Filling in a Description is optional, but it helps you to remember what sort of information is supposed to be stored in a field

Trang 86

Assign the Date/Time data type

1 In the Field Name column, in the second row, type:

Order Date

then press TAB

2 In the Data Type column, click the drop-down arrow

3 When the menu appears, click Date/Time, then press TAB

Trang 87

WORKING WITH TABLES

82

4 In the Description column, type:

Date the order was placed

then press TAB

Trang 88

Assign a Primary Key

1 Right-click the Order ID field

2 When the menu appears, click Primary Key

The field should now show a key beside it:

Trang 89

WORKING WITH TABLES

84

3 On the Menu Bar, click File, then Save

Trang 90

Specify field properties

1 Click in the Order Date field

2 In the Field Properties section of the window, click the

button next to the Format example box

Trang 91

WORKING WITH TABLES

86

3 In the menu of formats that appears, click 12/31/99

Then click the button

The Order Date’s Format example field should now look like

this:

Trang 92

4 On the Toolbar, click the icon

Tip: If a Warning window appears, click the button

The table design window should now look like this:

5 On the Menu Bar, click File, then Close to return to the

FlowerStore database window

Trang 93

WORKING WITH TABLES

88

Edit records

1 Open the Customers table

2 Click inside the Customer Name field for record number 1,

between the w and s in Andrews Floral

3 Insert an apostrophe

4 Press TAB eight times to move to the Phone Number field

Trang 94

5 Type:

2125554569

It should replace the previous text:

6 Click in any other record

Tip: Remember—changed data in a record is saved when you move off that record

The Customers table should now look like this:

Trang 95

WORKING WITH TABLES

90

Delete records

1 Right-click the button for HomeVase’s record

2 In the menu that appears, click Delete Rows

3 When the alert window appears, click the button

Tip: Once a record has been deleted from the database, it cannot be recovered

Ngày đăng: 20/03/2019, 13:25

🧩 Sản phẩm bạn có thể quan tâm