0% found this document useful (0 votes)
1 views48 pages

Tutorial Point MS Access

This document provides a comprehensive guide on creating a database in MS Access, detailing the steps to start Access, create a database from a template or from scratch, and the various data types supported by Access. It also covers the creation of tables, including defining fields and their data types, and how to add data to these tables using Datasheet View. The document emphasizes the importance of understanding data types and table structures for effective database management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views48 pages

Tutorial Point MS Access

This document provides a comprehensive guide on creating a database in MS Access, detailing the steps to start Access, create a database from a template or from scratch, and the various data types supported by Access. It also covers the creation of tables, including defining fields and their data types, and how to add data to these tables using Datasheet View. The document emphasizes the importance of understanding data types and table structures for effective database management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 48

MS Access - Create Database

In this chapter, we will be covering the


basic process of starting Access and
creating a database. This chapter will
also explain how to create a desktop
database by using a template and how to
build a database from scratch.
To create a database from a template,
we first need to open MS Access and you
will see the following screen in which
different Access database templates are
displayed.
To view the all the possible databases,
you can scroll down or you can also use
the search box.
Let us enter project in the search box
and press Enter. You will see the
database templates related to project
management.
Select the first template. You will see
more information related to this
template.
After selecting a template related to your
requirements, enter a name in the File
name field and you can also specify
another location for your file if you want.
Now, press the Create option. Access will
download that database template and
open a new blank database as shown in
the following screenshot.
Now, click the Navigation pane on the
left side and you will see all the other
objects that come with this database.
Click the Projects Navigation and select
the Object Type in the menu.
You will now see all the objects types
tables, queries, etc.

Create Blank Database


Sometimes database requirements can
be so specific that using and modifying
the existing templates requires more
work than just creating a database from
scratch. In such case, we make use of
blank database.
Step 1 − Let us now start by opening MS
Access.

Step 2 − Select Blank desktop database.


Enter the name and click the Create
button.
Step 3 − Access will create a new blank
database and will open up the table
which is also completely blank.
MS Access - Data Types

Every field in a table has


properties and these properties
define the field's characteristics
and behavior. The most
important property for a field is
its data type. A field's data type
determines what kind of data it
can store. MS Access supports
different types of data, each with
a specific purpose.


The data type determines the
kind of the values that users
can store in any given field.
 Each field can store data
consisting of only a single data
type.
Here are some of the most
common data types you will find
used in a typical Microsoft
Access database.

Type of
Descripti
Data Size
on
Text or
combinations
of text and
numbers,
including
Up to 255
Short Text numbers that
characters.
do not
require
calculating
(e.g. phone
numbers).
Lengthy text
or
Long Text combinations Up to 63, 999
of text and characters.
numbers.
Numeric 1, 2, 4, or 8
data used in bytes (16 bytes
Number
mathematical if set to
calculations. Replication ID).
Date and
time values
Date/Time for the years 8 bytes
100 through
9999.
Currency Currency 8 bytes
values and
numeric data
used in
mathematical
calculations
involving
data with one
to four
decimal
places.
A unique
sequential
(incremented
by 1) number
or random
number 4 bytes (16
AutoNumber assigned by bytes if set to
Microsoft Replication ID).
Access
whenever a
new record is
added to a
table.
Yes/No Yes and No 1 bit.
values and
fields that
contain only
one of two
values
(Yes/No,
True/False,
or On/Off).
Descripti
Data Size
on
Types
Files, such as
digital
photos.
Multiple
files can be
attached per Up to about 2
Attachment
record. This GB.
data type is
not available
in earlier
versions of
Access.
OLE objects
can store
pictures,
 If you use previous versions of
Access, you will notice a
difference for two of those
data types.
 In Access 2013, we now have
two data types short text and
long text. In previous versions
of Access these data types
were called text and memo.
 The text field is referred to as
short text and your memo
field is now called long text.
Here are some of the other more
specialized data types, you can
choose from in Access.
These are all the different data
types that you can choose from
when creating fields in a
Microsoft Access table.
Note!
Object Linking and Embedding (OLE) is a
proprietary technology developed by
Microsoft that allows embedding and
linking to documents and other objects.
MS Access - Create Tables

When you create a database,


you store your data in tables.
Because other database objects
depend so heavily on tables, you
should always start your design
of a database by creating all of
its tables and then creating any
other object. Before you create
tables, carefully consider your
requirements and determine all
the tables that you need.
Let us try and create the first
table that will store the basic
contact information concerning
the employees as shown in the
following table −
Field Name Data Type
EmployeelD AutoNumber
FirstName Short Text
LastName Short Text
Address1 Short Text
Address2 Short Text
City Short Text
State Short Text
Zip Short Text
Phone Short Text
Phone Type Short Text
Let us now have short text as
the data type for all these fields
and open a blank database in
Access.

This is where we left things off.


We created the database and
then Access automatically
opened up this table-one-
datasheet view for a table.

Let us now go to the Field tab


and you will see that it is also
automatically created. The ID
which is an AutoNumber field
acts as our unique identifier and
is the primary key for this table.
The ID field has already been
created and we now want to
rename it to suit our conditions.
This is an Employee table and
this will be the unique identifier
for our employees.

Click on the Name &


Caption option in the Ribbon
and you will see the following
dialog box.
Change the name of this field
to EmployeeID to make it more
specific to this table. Enter the
other optional information if you
want and click Ok.
We now have our employee ID
field with the caption Employee
ID. This is automatically set to
auto number so we don't really
need to change the data type.
Let us now add some more fields
by clicking on click to add.

Choose Short Text as the field.


When you choose short text,
Access will then highlight that
field name automatically and all
you have to do is type the field
name.

Type FirstName as the field


name. Similarly, add all the
required fields as shown in the
following screenshot.
Once all the fields are added,
click the Save icon.
You will now see the Save
As dialog box, where you can
enter a table name for the table.

Enter the name of your table in


the Table Name field. Here
the tbl prefix stands for table.
Let us click Ok and you will see
your table in the navigation
pane.

Table Design View


As we have already created one
table using Datasheet View.
We will now create another table
using the Table Design View.
We will be creating the following
fields in this table. These tables
will store some of the
information for various book
projects.
Field Name Data Type
Project ID AutoNumber
ProjectName Short Text
ManagingEditor Short Text
Author Short Text
PStatus Short Text
Contracts Attachment
ProjectStart Date/Time
ProjectEnd Date/Time
Budget Currency
ProjectNotes Long Text
Let us now go to the Create tab.

In the tables group, click on


Table and you can see this looks
completely different from the
Datasheet View. In this view, you
can see the field
name and data type side by
side.

We now need to
make ProjectID a primary key
for this table, so let us
select ProjectID and click
on Primary Key option in the
ribbon.
You can now see a little key icon
that will show up next to that
field. This shows that the field is
part of the tables primary key.
Let us save this table and give
this table a name.
Click Ok and you can now see
what this table looks like in the
Datasheet View.

Let us click the datasheet view


button on the top left corner of
the ribbon.
If you ever want to make
changes to this table or any
specific field, you don't always
have to go back to the Design
View to change it. You can also
change it from the Datasheet
View. Let us update the PStatus
field as shown in the following
screenshot.
Click Ok and you will see the
changes.
MS Access - Adding Data
An Access database is not a file
in the same sense as a Microsoft
Office Word document or a
Microsoft Office PowerPoint are.
Instead, an Access database is a
collection of objects like tables,
forms, reports, queries etc. that
must work together for a
database to function properly.
We have now created two tables
with all of the fields and field
properties necessary in our
database. To view, change,
insert, or delete data in a table
within Access, you can use the
tables Datasheet View.
 A datasheet is a simple way to
look at your data in rows and
columns without any special
formatting.
 Whenever you create a new
web table, Access
automatically creates two
views that you can start using
immediately for data entry.
 A table open in Datasheet
View resembles an Excel
worksheet, and you can type
or paste data into one or more
fields.
 You do not need to explicitly
save your data. Access
commits your changes to the
table when you move the
cursor to a new field in the
same row, or when you move
the cursor to another row.
 By default, the fields in an
Access database are set to
accept a specific type of data,
such as text or numbers. You
must enter the type of data
that the field is set to accept.
If you don't, Access displays
an error message −
Let us add some data into your
tables by opening the Access
database we have created.
Select the Views →
Datasheet View option in the
ribbon and add some data as
shown in the following
screenshot.
Similarly, add some data in the
second table as well as shown in
the following screenshot.
You can now see that inserting a
new data and updating the
existing data is very simple in
Datasheet View as working in
spreadsheet. But if you want to
delete any data you need to
select the entire row first as
shown in the following
screenshot.
Now press the delete button.
This will display the confirmation
message.

Click Yes and you will see that


the selected record is deleted
now.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy