Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

MICROSOFT ACCESS DATABASE

Database - A database is the container in which your information resides.

A database is a collection of information that is related to a particular topic or


purpose. The key to efficient storage and retrieval of data is the planning process.
By first identifying what you want the database to do for you; you will be able to
create a practical design that will result in a faster, more accurate data management
tool.

Microsoft Access helps you to manage your database by providing an efficient


structure to store and retrieve information. The place you assemble information
about each subject you decide to track is called a field. Access can produce a form
for you to fill in your data and you may request to display a selected part of
information by using features such as FIND, SORT, and QUERY. Access can then
help you print just any part of the information you wish to see in a REPORT.

Examples of manual databases:


Phone book, library catalogue, patient information at a hospital, national voter
information

Advantages of using a computerised database management system:


Information can be retrieved faster in ad hoc situations using queries;
You can design and create your own queries with minimal knowledge of databases;
Data duplication is reduced.

Disadvantages of using a computerised database management system:


They are more time consuming to design than a manual database;
Initial training is required.

Table structure - a plan that shows the names, data types and the field sizes of
fields in a table.

Field name - A descriptive name given to a field. The field name is one continuous
word of not more than 10 characters. For e.g. A field name for a person’s
identification number could be “ID_NUMB”.

Field size - the maximum number of characters or value that can be entered for a
field given its type.

Field Type - the field type describes what kind of data to use for a field based on the
kind of value to allow in field. The kind of values is: Text, number, yes/no, currency,
date/time, memo
Field Description - this is optional and is used to describe the field. Whatever is
typed here is displayed on The status bar when entries are being made in a Form.

Six data types used in Microsoft Access are


Text - text or combination of text and numbers, such as names and addresses also
numbers that do not require mathematical operations to be performed on them, for
example, a person’s phone number.

Memo - entries that are too long to be used as a text, for example, a paragraph.

Number - Numeric data to be used for mathematical calculations, except monetary


calculations.

Currency - Used for data that involves currency.

Yes/No - Field that contains one of two values.

Date/Time - Use for date fields.

Note - There are other field types available but we will not discuss these at this time.

What is the difference between Long integer and Double field sizes of Number?
Long integer is used to store integer values between approximately -2 billion and +2
billion without any decimal places.
Double is used to store integer values between -2 billion and +2 billion with decimal
places.

Terms related to databases:


Tuple - The details about a particular entity are called a tuple. A tuple is represented
by a record in a database.
Entity - An entity is an item in the real world that is represented in a database.
Attribute - The individual properties of an entity are called its attributes. An attribute
is represented by a field in a database.
Relationship linking of tables or files to share records
Field type or data type type of data that a field can store
Field size - amount of information that a field can store
A primary key field is a field that acts as a unique identifier for each record in a
table;
A foreign key field is a field in a table that is has been linked with the primary key
field of another table.
A secondary key (or alternate key) is a candidate key that has not been selected
as the primary key;
A composite key is a primary key that consists of two or more fields together.
A candidate key is a field that could possibly act as the primary key for the table;
A secondary key or alternative key is a candidate key that is not being used as a
primary key.

STRUCTURE OF AN ACCESS DATABASE


An Access database is comprised of a group of related structures, namely Tables,
Forms, Queries and Reports. This database may consist of a single table (or
several) and will have forms, reports, queries and mailing lists associated with it and
named in a similar manner.

TABLES are individual databases within the one file all of which share information
on a common item, hence instead of having one large database, there will now be
several smaller ones with related information and with which relationships may be
structurally established.

FORMS are individual structures designed to allow easy input of data in the pre-
designed tables. With an appropriate form designed, data will not have to be entered
via the datasheet, but through this form which lends some degree of automation.

QUERIES are combined search routines based on certain filtering and sorting
requirements, which are saved as files and are available for later use, especially if
frequently required.

REPORTS are provided for a user to completely manipulate data entered in these
databases and get a hard copy/printed output of selected portions of information.
Some of this may be specialized requests such as customers’ addresses, which may
be printed as specialized reports known as MAILING LABELS.

PROCEDURES
TO CREATE A DATABASE
NB as with all other windows based applications; there are several methods of
accomplishing the same task. Where menu options are used, the appropriate toolbar
button may be chosen.

From the File menu, select New Database


1. Enter the name of your database and select OK, then select New, New Table.
2. At this point you will be presented with the design view of your database
structure, showing Field Name, Data Type and Description.
3. Enter the first Field Name e.g. (Firstname), (the properties screen appears
below) then the Data Type
4. (Alphanumeric, numeric, true/false, numbers only, date etc), Description (may
be left blank)
5. Enter as many other fields as are necessary for this database/table.
6. You will need to set a Primary Key that will be a field containing information
unique to each record
7. Or item. Decide on this early as you will need to set this before your file can
be saved.
TO MODIFY A DATABASE TABLE
With the appropriate database opened, select Design. This allows you make edits to
the structure of the table i.e. the fields and their properties. Click on the required field
and once highlighted, it may be Moved (dragged to a new position), Deleted (press
the delete key), its properties may be changed, the Data Type and Description, a
new field may be added, the row heights and column widths changed by clicking on
the row and column selectors and dragging to the desired height or width.

Select File, Close to save the new changes.

UPDATING THE DATABASE


Now that your database has been created, you may begin adding data to the table.
Select Open, and on the Datasheet presented to you, proceed to enter the
appropriate information. When you are through, select File, Close and your file will
be saved.

To EDIT information in your table, you may again follow this process. Records may
be modified, deleted or added here. Movement on this Datasheet is done with the
arrows, however freezing important columns in the Format menu may contain
scrolling.

You may Delete records (by clicking on the record selector and from the Edit menu
select Record, Delete.

Conditional Searches
Records may be selectively displayed on screen temporarily, (using Find, from the
Edit Menu), or the Filter options in the Records Menu. A permanent record of this
sorted information may be sorted as a QUERY.

Go to the Datasheet view of your table (select Open), and from the Edit Menu, select
Find. Enter the appropriate text and OK. If you need to replace, select Replace from
the Edit Menu, and follow the dialog boxes.

To display filtered information, from the Records Menu, select Edit Filter/Sort, set the
field/s and criterion/criteria, OK. Records may be rearranged/sorted so that the users
may more readily access them. This is also accomplished from the Records, Quick
Sort menu options.

Creating Forms
Screens may be generated in order to effect easier data entry.
Select Form from the Database toolbar to the left of the screen.
Enter the name of your database table with which it will be associated and give your
form a name.
At this point you will be presented with the design view of your Form structure, an
area in which
Fields and other enhancements are to be placed.
From the Edit menu, select Field List. Drag the varying list to the appropriate areas
on the screen
Enter as many other fields as are necessary for this form.
When the last field’s information is entered, select File, Close. You are now ready to
enter information/data using this form and you will notice that previously entered
data in this table assume their positions on this form.

Generating A Query
Queries are created to facilitate easier retrieval of information required from a
database frequently. These are essentially listings of varied criteria that are then
displayed when the Query is run.

Select Query, New, New Query from the Database window to the left of the screen.
Enter the name of your database table with which it will be associated and select
Add, Close.
At this point you will be presented with the design view of your Form structure, an
area in which fields & Other enhancements are to be placed. Drag the varying lists
to the appropriate areas on the screen. Enter as many other fields as are necessary
for this Query, the Query may then be previewed & saved.

Generating Reports
Select Report, New, from the Database window to the left of the screen.

Enter the name of your database table with which it will be associated. At this point
you will be presented with the design view of your Report structure, an area in which
fields and other enhancements are to be placed.

From the Edit menu, select Field List (if it is not displayed). Drag the varying fields to
the appropriate areas of the DETAIL section on the screen. The accompanying text
in the box represents the field title.

Enter as many other fields as are necessary for this Report.

The page Headers and Footers may be added by selecting the Text Tool from the
Toolbar at the left of the screen and added to the sections assigned to them. You
may also include a Report Header and Footer. The following will display the day’s
date; =date () and should be entered using the TEXT BOX option from the Toolbar
mentioned above. Other functions which can be entered are;
=”Page” &page displays the page number
=”Page” & page & “of “ pages displays page current of total
The report may then be then be previewed and if satisfactory, saved.

TIPS (ACCESS)

Signs Used:
> Greater Than
< Less Than
<= Less Than or Equal To
>= Greater Than or Equal To
< >Not Equal To
= Equal To

Conjunctions Used:
“or” “and”

N: B: - Make copies of your queries to save time if necessary. More than one Criteria
can be joined by an “and” and an “or”. When using a text field, the criteria must be
quoted e.g. =”Tom”. When some groups appear on more than page (Point to that
field’s header bar, Select grouping and sorting, change the “Keep Together” option
to “Whole Group”.

Revision Notes
The First step in the creation of a table is to create a data dictionary for the table. A
dictionary describes the information to be stored in the table. You make a field type
number only if you plan to manipulate it mathematically. You create a new database
by selecting File, New Database from the menu bar at the top of the screen.
When using the Table Wizard to create a table, if you do not see a field in the
sample fields list box for a specific type of information you want to collect, this field
can be added to the design later. The Byte size for numbers allows you to enter
numbers between 0 and 255.

If you accidentally open a wrong table or database you can close it by clicking the ‘x’
in the upper right hand corner of the window. Each new record added to the table is
automatically save by Microsoft Access. Microsoft Access searches through an
entire table instead of just a single field, but this can take much longer in a large
table. Whenever possible try to limit the search to the specific field where you
believe this information is located.

Criteria are restrictions that facilitate the filtering of specific information to a user.
The are several types of queries. For our purpose we will look at the SELECT
QUERY. This type of query allows you to select records from one or more tables that
match certain criteria. For example, you may want to design a query that performs
any of the following tasks:
a. Show all records that match a certain criterion
b. Delete all records that match a certain criterion
c. Add information from one table to another
d. Display selected records from several tables at once.
Once you have created a query you can use the query as the basis to create a
report.

You can create a query to do the following:


Display all records that match a certain criteria from a single table.
. Update specific fields in a table
. Display specific information from two or more tables at once
. Delete records from a table that meet certain criteria

A Query can be modified at any time to change the criteria or the displayed fields. If
queries are similar for a few minor adjustments. It saves time to copy the query and
modify its design. When creating a query that needs information from more than one
database file one approach is to create a query that links the file, then use the query,
to create the report.

When you create a query using the Query Wizard or the Query Design option the
query is a Select Query. You can change to Delete or an Update Query by selecting
Query from the menu bar and selecting the type of query you want.

Data Grouping is used to group records that have a common filed value. For
example in the CATALOG table we can group all records with a particular code.
Then we can summarize information for the group of records.

To insert summary information for all the records in the report, insert the summary
information in either the report header or the report footer. If you want summary
information for a group you put the information in the group header or group footer.

Examples of queries:
(<=2 or >=23),
<Date Value (“01-Jan-60”)
[POM+1], =MAX ([POM]), [FEE]*.6
([RetDate]-[DUEDATE])*30, =”GEO”

You might also like