Access Databases Module 5

advertisement
A database
Help and click sample databases


This is a collection of data organised for a
specific theme in one or more tables, e.g video
library. Can use to keep a record of customers.
Carzone use to split their cars into different
data types. A field is a specific piece of
information e.g name, address etc. A record is a
list of info on a customer for example
Table is a two dimensional structure where
data is stored like in a spreadsheet e.g video
catalogue ie names of all the videos




Record: A row of info (name of video, director,
year made , date last rented etc)
Field: one video name in a cell
Preparing your folder;
You can enter practise files into access
otherwise its just a blank database that u cant
yet work on



Click start all programs, microsoft office then
microsoft access. You ll see a task pane pop up
on your right.
Open a database someone has already created.
These template can be downloaded from the
internet for most things which saves companies
time in creating from blank.
Be careful to save correctly with good name
and .mdb are access files



Here look at the title bar at the top to see what
database you’re in.
U have options of open, design and new then
on the left tables queries etc. This is your main
screen.
To create a new table double click create table
in design view the main screen. Type number
in field name and click number function as
data type


Tab button is used always. P216 enter data
How to assign a primary key
Every record must have one field that is diff to any
other. This is is your primary key. E.g pps numbers
 Click on the field number then click the key symbol.



To switch to datasheet view to enter data click
the data sheet tool p217 or select view
datasheet
Save your table





Similar to excel
Select table u saved and double click to open
Click the tab called design to change to design
view to see what the design of it looks like,
whereas datasheet view is to see where ur data
is entered.
Sorting in a table works the same way as excel
To search for info click the binoculars button.
Use M* for any names beginning with m. click
on employees table to see binoculars button





In dsv (Data Sheet View) click the red play
arrow
To delete click the red x
Col wid and height are changed by format or
double click between the lines
To change table layout click table tab click on
your table and then click design option
Any change u make in design view will also
update ur dsv.



Each field has properties that u can change at
the bottom of the screen of ur table.
Fields can be indexed click lighning button to
view.
Hit f6 when in table to go to field properties

Click design view, click the open boxes button
To reorder use drag and drop

Printing can specify records to print







E.g only see all dvds 2010
Highlight the records that have 2010 in it
Click the lightning button that has a filter pic
on it.
The records appear at the top p226
Click pic of filter alone to view all records
again
Or click drop down menu in table and click
same pic





For a better view of your data
Click forms now instead of table and create
using the wizard
Select the the fields you will use by click <
button or click << button and this will select all
fields
Select columar, then standard
Play button with * creates a new record





Click design view
Drag out form to 22cm from the right width
and 8cm down
Click form view pic of two little boxes p230
To move a label wait for cursor to turn to a
hand and drag. 1 finger raised means only part
will be moved
Click view and header ticked







Used to analyse data from tables
Click design view and create query
Choose what table to query and add
In the small sqaure window choose fields and
drag down to lower design grid
Click ascending order if u want
Click save
To run a query click the ! Button. Click x to
close











Click the tick on show to hide fields
= 2010 – all movies in 2010
<> euro all record that do not have euro
< 10 numbers less than ten
<=
>, >=
BETWEEN finds values between or equal to 2 values
e.g between 18 and 45
IN (romance,horrer)
find records A* , beginnin with A
You put these commands into the criteria tab
p238


Put byrne or burn into criteria tab will find
both
Also u can type not romance








Load file then Use wizard then modify
Tables tab then double click e.g educational sites
table
Choose the fields u want using the arrows
Then u can choose to group records by whatever
field
Can sort order from a field or leave blank and click
next
Click design view to edit parts
U can inset text box click Aa.
Click shift and select fields to change font to 10



When u have many tables with many records
e.g pps, addresses but also pps numbers with
tax details. Until access is told that these two
different tables are related they will act
separtately. To set up relationships the related
fields must be of the same type.
E.g one husband record marries one wife
record so ther relationship is one to one
However One manager manages many players
so the relationship is one to many


Also Many managers can Manage many teams
Or many students can study many subjects if a
principal was using access to form a database




To form a one to one first views all your tables
Click the three connected boxes button p249
Click on the field that’s common to most
headings e.g country (the primary key) and
click and drag to the other box
Make sure in the edit relationship window that
you two different titled tables and under them
is the word country. Also tick all the boxes
below such as enforce ref integrity.





Ref integrity ensures relationships with records are
valid and related data isnt deleted or changed
Cascade means any time the primary key si
changed in the link then the foreign key also
changes
Cascade delete means if a record is deleted so is
the related record.
Changing the primary table link field will change
the related but not visa versa
Clicking on the + will show u more info and +
means this field has a link with another table




Same idea.
Tables in a circle are already linked
Delete by clicking on line and click delete
Tick boxes and run query






Data is raw facts whereas info is data processed in
some way
Each field in a table should contain only one type of
data.
To find and sort faster use an index
Nb to keep integrity of relationships cos it prevents
related data being challenged or deleted.
If data is changed in a table data might be lost
An administrator recovers data after a database crash.






For default values in the notes field click design view ,
general tab, type new
Add a field to a table, click design view, select memo
data type, click save
Filter Classid 2 only. Click datasheet view, select a 2,
click filter by selection.
Query using only 4 in locationid, create query in
design view, enter 4 in the criteria under location
To hide uncheck box
Only large cars: double click on fields that should be in
the query, enter Large in criteria on class field,






To modify older cars query for a brand of car. Design view, enter
brand on the row for car filed, always save when things are
changed
Records starting with B only. Design view, enter Like “B*” in
criteria at city field, save
Change text in form header to Adding new locations. Design
view, form header, select the label in the form header, press F2,
change the text
To delete record 4, open form view, next x 4, click delete record
number (play button with a red star).
To print all records in cars table, the all radio button
Create report using total rental query; create report using wizard,
select quer total rental from tables drop down list, click >> button,
next, summary options button, click check price for sum under
price field, next x 3, type rental, click finish










Databases
First screen
Datasheet view
Inserting records/fields
Form View
Filtering
Criteria
Relationships
Queries
Common errors


Basic 10 min Tutorial
Advanced Access Tutorial
Download