MS Access 2007
MS Access 2007
MS Access 2007
“© 2008 Infosys Technologies Ltd. This document contains valuable confidential and proprietary information
of Infosys. Such confidential and proprietary information includes, amongst others, proprietary intellectual
property which can be legally protected and commercialized. Such information is furnished herein for training
purposes only. Except with the express prior written permission of Infosys, this document and the information
contained herein may not be published, disclosed, or used for any other purpose.”
Confidential Information
• This Document is confidential to Infosys Technologies Limited. This document contains
information and data that Infosys considers confidential and proprietary (“Confidential
Information”).
• Confidential Information includes, but is not limited to, the following:
– Corporate and Infrastructure information about Infosys;
– Infosys’ project management and quality processes;
– Project experiences provided included as illustrative case studies.
• Any disclosure of Confidential Information to, or use of it by a third party, will be damaging to
Infosys.
• Ownership of all Infosys Confidential Information, no matter in what media it resides, remains
with Infosys.
• Confidential information in this document shall not be disclosed, duplicated or used – in
whole or in part – for any purpose without specific written permission of an authorized
representative of Infosys.
• This document also contains third party confidential and proprietary information. Such third
party information has been included by Infosys after receiving due written permissions and
authorizations from the party/ies. Such third party confidential and proprietary information
shall not be disclosed, duplicated or used – in whole or in part – for any purpose without
specific written permission of an authorized representative of Infosys.
2
What is Microsoft Access?
8 8
What is in MS-Access?
• Field: a field is a column in a table and defines a data type for
a set of values in a table. For example, a mailing list table
might include fields for first name, last name, address, city,
state, zip code, and telephone number.
• Record: a record in a row in a table and is a set of values
defined by fields. In a mailing list table, each record would
contain the data for one person as specified by the intersecting
fields.
• Data type: data types are the properties of each field. A field
only has one data type, such as Character, Number or Date.
• Primary Key: a primary key is a value that can be used to
identify a unique record in a table.
• Design View: it provides the tools for creating fields in a table.
• Datasheet View: it allows you to update, edit, and delete in
formation from a table.
9 9
Access window
• Title Bar:Displays name of the Database
• Tabs in ribbon-display different tyes of commands based
on the category you select
• Ribbon-has commands that reflect the active contextual
tab, your position in the database and the selected
objects
• Navigation Pane: displays database objects of the types
you select
• Object window : displays any open data base objects
• Status bar- indicates the progress of any ongoing
process
10 10
Object window
• Object Tab: displays all open database objects
• Close button: To close the active database object with a
single mouse click
• Opening a data base object displays contextual tabs that
contain design and formatting tools
• Horizontal Scroll bar: To move to side within the object
• Vertical Scroll Bar: To move up and down within your
project
• Right clicking the control on the body of a database
object while you display the object in Design view
displays a contextual menu that enables you to edit the
selected control
11 11
Starting Access and Creating Database
• Click on the START button on your computer and position
your cursor over the PROGRAMS menu to view a list of
installed programs. Once you see the list, position the cursor
over Microsoft Office and then click on Microsoft Access
2007.
12 12
2. After opening Access, you will be presented with the window
shown below Figure
13 13
3.Open a database on start up
• Click More
• Navigate to the folder with the database to be opened
• Double click the file to be opened
14 14
4.Open recently used database
• Start MS Access 2007
• In the open recent database section, click the name of the
database you want to open
15 15
5. Creating Database from a template
• Click a template category
• Click on the desired template
• Type a name for your database
• Navigate to the folder where you want to store the newly
created database
• Click ok
• Click download
16 16
Database Components
• An Access database consists of several different components.
Each component listed is called an object.
• Tables Tables are where the actual data is defined and entered.
Tables consist of records (rows) and fields (columns).
• Queries Queries are basically questions about the data in a
database. A query consists of specifications indicating which
fields, records, and summaries you want to see from a
database. Queries allow you to extract data based on the
criteria you define.
• Forms Forms are designed to ease the data entry process. For
example, you can create a data entry form that looks exactly
like a paper form. People generally prefer to enter data into a
well-designed form, rather than a table.
17 17
Database Components
• Reports When you want to print records from your database,
design a report. Access even has a wizard to help produce
mailing labels.
• Pages A data access page is a special type of Web page
designed for viewing and working with data from the Internet
or an intranet. This data is stored in a Microsoft Access
database or a Microsoft SQL Server database.
• Macros A macro is a set of one or more actions that each
performs a particular operation, such as opening a form or
printing a report. Macros can help you automate common
tasks. For example, you can run a macro that prints a report
when a user clicks a command button.
• Modules A module is a collection of Visual Basic for
Applications declarations and procedures that are stored
together as a unit.
18 18
Microsoft Access – Module 1 Summary
21 21
Creating Tables in Database
22 22
Modifying Table
• Right click the table you want to modify
• Click design view
• You can either delete/add/reorder fields
– Delete a field: click the row selector of the row you want to
delete , click the delete rows button, click yes to confirm
– To add a field, click the row selector of the row below
where you want the new field to appear, use the Insert row
button to insert and type a name for the field. Click the
row’s Data type cell, click the down arrow that appears, and
then click the desired data type.
– To reorder the field: Use the row selector drag and drop it
to the new desired position
23 23
Modifying Table
24 24
Adding Data to a Table
• Once the table is opened the existing the data can be
edited or new data can be added.
• Selecting the text
– Move the mouse pointer over cell. When it turns white
cross, click in the cell. Double click the text/Drag
mouse to extend the selection
• Delete text: Select the text and use del key.
• Undo operation: Use undo button in the quick access
toolbar
• Copy and paste text: Select the text to copy. Click the
Home tab, click the copy button, click the position where
the text is pasted, Click the paste button
25 25
Table Relationships
• If the primary key in one table is found with another table,
relationship can be created between the two tables.
Click Relationships
• If the tables needed are not present in the relationships
window, click the show table button
• Click the first table to add to the Relationships window
• Click Add
• Repeat steps 4 and 5 as necessary
• Once finished adding the tables, click Close
• Drag the primary key in first table to the related foreign key
field in the second table
• Click create, use close button to close the relationships window
27 27
Importing Data
• There are situations where data from one database
would be needed in another data base too.
• The External data tab will be useful in such cases like
– Copying tables from a data base
• You can import data from other types of data base
objects like query by choosing the appropriate object
type from the Import Objects dialog box and then
clicking the object name from which you need to get the
data
28 28
Copy a table from another Database
• Click the External data tab
• Click Access
• Click Browse
• Double click the data base from which you want to import
the table
• Choose the option “Select the tables, Queries, Forms,
Reports, Macros, and Modules Into the current Database
option
• Click OK
• Click the Tables/Table to import
• Click OK
29 29
Copy a table from another Database
30 30
Copy a table from another Database
31 31
Exporting Data
• Exporting an Access table/query data to an Excel work
book takes a few steps
– Click the table /query to be exported
– Click the External Data Tab
– In the Export group, click the export to Excel
spreadsheet button
– Type a name for the file (If needed select the Export
Data with Formatting and Layout option)
– Click ok
– Click Close
32 32
Exporting Data
33 33
MS Access – Module 2 Summary
38 38
Create a Detail Query
• Click on the Create Tab
• Click on the Query Wizard
• Click the Simple Query Wizard
• Give OK
• Click the Tables/Queries down arrow and then click the
table or query having field to be used in the query under
construction
• Click the first field to be included in the query results
• Click Add
• Do the same for the all the field to be included in the
query under construction
39 39
Create a Detail Query (continued)
• Click Next
• Click the Detail option button
• Click Next
• Give a name for the newly created query
• Click Finish
40 40
Query Wizard
41 41
2-Table Query
• Click on Create
• Click Query Design
• Select the tables to be queried
• Select the fields to be shown
• Save the query by giving a name
• Then go to query wizard
• Select the created query to obtain the data
42 42
2-Table Query
43 43
2-Table Query
44 44
Query – Calculating Fields
= equals
> greater than
>= greater than or equal
< less than
<= less than or equal
<> not equal to
Between between two values
Is Null field is empty
is not null field is not empty
Like Matches a pattern (Like John*)
OR Logical OR (one or other is true)
AND Logical AND (both are true)
etc.
Under the hood, queries are really nothing more than stored SQL
statements that are run upon command. They add little mass to
the file application.
52 52
Query Practice
Design and save a new query named Question2 to provide
summary data for each Student(ie we want to see all the
students data in separate rows). For each of these
compute: 1) Total marks obtained; 2) and average of
marks.
53 53
Thank You
“The contents of this document are proprietary and confidential to Infosys Technologies Ltd. and may not be
disclosed in whole or in part at any time, to any third party without the prior written consent of
Infosys Technologies Ltd.”
“© 2007 Infosys Technologies Ltd. All rights reserved. Copyright in the whole and any part of this document
belongs to Infosys Technologies Ltd. This work may not be used, sold, transferred, adapted, abridged, copied or
reproduced in whole or in part, in any manner or form, or in any media, without the prior written consent of Infosys
Technologies Ltd.”
ER/CORP/CRS/<C