Beruflich Dokumente
Kultur Dokumente
1. Menu bar: displays menu with all the features available in the program
2. Standard Toolbar: shortcuts to the commonly used features
3. Database window: shows all the objects in the database
4. Database window toolbar: buttons for opening objects and creating new objects in the database
5. Objects pane: allows you to switch which objects (tables, queries, forms) you are viewing and opening
6. The database user can adjust the amount of information displayed in the database window using the view
buttons
4
6
• Tables: The data in a database is stored in its tables. A table is a collection of data about a specific topic.
Tables in a database are joined by a common field, which allows us to utilize data from any of the tables.
• Queries: Queries can be used to view, change and analyze data. Queries allow you to control which
tables, which fields and which records you view. They can also be a source for the data for forms and
reports.
• Forms: Forms are used to view data one record at a time (rather than in table view), and also as a data
entry tool.
• Reports: Access reports allow you to present your data in an effective printed format. Reports can
include all your data, selected parts of your data or summary data.
In datasheet view, a table displays as a series of columns (fields) and rows (records). In datasheet view the user
can find records, sort them, filter, edit, delete and enter new records.
Saving/Undoing
An important thing to note about working in datasheet view is that a record being entered or edited is saved
automatically, as soon as the user moves to another record. There is only one undo available in datasheet view,
and undo is not available after the deletion of a record.
1
3
2
1. In design, the first pane lists the name of each field (column) in the table
2. Next to the name, the designer must identify the type of data that will be contained in that field.
3. A description area is also available. The designer can include notes about any field which may help
others using the database.
4. Each field has its own properties sheet. The designer can set constraints here that control what the user
can put in the database.
Field Size For text, the maximum number of characters that can be entered in the field. For numbers,
the type of number the field can contain
Format Select a pre-defined format, or create a custom format, such as 0000000 to require the
display of 7 characters. See Access help for sample formats.
Input mask Allows you to set a pattern for data to be entered, such as (xxx)xxx-xxxx for phone
numbers. Access has a wizard to assist with the setup of input masks.
Caption Controls how the field name appears when a user views the table. Allows for the use of
naming conventions with field names, but for “friendly name” to appear to users.
Default Value A value that will appear if no other value is entered in the field
Validation rule Allow constraints on the data that can be entered. “Like EN*” would require EN at the
start of every entry.
Validation text Text for the message that will appear of a user violates the previously set validation rule.
Required Allows designer to require a particular field to be complete for the record to be saved
Allow Zero In combination with the required property, can be used to control whether a blank value
Length means you don’t have data or whether there is no data
Indexed Indexing speeds up sorting but may slow the database overall. Index on fields you
commonly search or sort on.
Primary key
The power of a relational database is in the ability to pull data from multiple tables. In order to do this, each
record in a table must be uniquely identified. This is done with a primary key. For example, a SSN or student ID
can be considered a unique identifier, if it is not repeated anywhere in the table.
One-to-one: Each record in table 1 has only one corresponding record in table 2, and each record in table 2 has
only one corresponding record in table 1.
One-to-many: each record in table one may have multiple corresponding records in table two. Each record in
table 2 has only 1 corresponding record in table 1.
Many-to-many: Although a many to many relationship is possible, it is not desirable, and a third table will
usually be introduced to allow 2 one-to-many relationships.
Hartwick College Technology Services 10
Creating Table Relationships
Table relationships are established using the relationships window. Be sure all tables you will work with are
closed before working on relationships.
1. From the database window, click the “relationships” button. 1
2. In the blank relationships window, click the “show tables” button on the toolbar.
2
3. Select the tables you wish to work on and click Add. Multiple tables can be selected using Ctrl+click.
4. Starting with a parent table, locate the field that is contained in both the parent and child tables.
5. Click and drag that field from the parent table and drop it on that field in the child table
6. In the example below, tblDepartmentCodesNames is the parent, and the field strDeptCode is dragged to the
matching field in the Payroll table.
Referential Integrity
Referential integrity is a set of rules designed to prevent you from accidentally deleting or changing records in a
primary or parent table when there are related records in a secondary table.
To set referential integrity, click the checkbox before creating the join.
Cascade Update
If cascade update is selected, then if a record is changed in a primary table, the related records in a secondary
table are updated. For example, if you changed a primary key in the primary table, the new key would be
reflected in any related records. Referential integrity must be enforced for cascade update to be available.
Cascade Delete
If cascade delete is selected, and a record is deleted from a primary table, all related records in the secondary
table are deleted. USE EXTREME CAUTION with this feature. Referential integrity must be enforced for
cascade delete to be available.
Editing relationships
It is possible to delete or edit relationships once they are created. Double-clicking on a join line will reopen the
edit relationships window, where referential integrity can be added, removed or cascade update and delete can
be added or removed.
A single click on a join line will select it. Once it is selected, it can be deleted with the delete key on your
keyboard, or the delete key on the relationships window toolbar.
Relationships window with two completed joins, with referential integrity enforced.
Join line
2 4 5
6. A 2-step wizard will launch to walk you through the linking of the table
7. In the first step, indicate whether your spreadsheet has column headings (it should) and click next
8. In the second (final) step, enter a name for your linked table and click finish.
7
8
3
2
4 5
8
7
10
9
11. Step 6 will ask you to name the new table. Enter a name and click finish.
12. You database window displays the imported and linked tables differently.
11
12