0% found this document useful (0 votes)
86 views

1.1.1 Creating A New Database Without Wizards

The document provides instructions on how to create a new database and tables in Microsoft Access without using wizards. It includes 4 steps to create a table: 1) creating the table, 2) creating fields and specifying data types, 3) designating a primary key field, and 4) saving the table. Various data types are described such as text, number, date/time, currency, autoNumber, yes/no, and their uses. Examples of tables to create include OrderMaster, OrderDetail, Customer, and Pending with corresponding fields and data types.

Uploaded by

adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views

1.1.1 Creating A New Database Without Wizards

The document provides instructions on how to create a new database and tables in Microsoft Access without using wizards. It includes 4 steps to create a table: 1) creating the table, 2) creating fields and specifying data types, 3) designating a primary key field, and 4) saving the table. Various data types are described such as text, number, date/time, currency, autoNumber, yes/no, and their uses. Examples of tables to create include OrderMaster, OrderDetail, Customer, and Pending with corresponding fields and data types.

Uploaded by

adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

Introduction to Database Shazia Abbasi

1.1 Creating a New Database


1.1.1 Creating a New Database without Wizards
1. Click on the File menu
2. Click on New
or
Click on New icon
3. Click General tab
4. Select Blank Database

5. Click OK
6. Change the folder to save the database in, if required

Click the down


arrow to
change the
folder

Type the
filename here

7. Type the filename for your database – for this lab StrongHold.mdb
8. Click Create -> Database window will appear

Why do I give the filename and choose the folder first?


The database is created and saved first. Then the tables, queries, forms etc.
are added to the database. If you didn't save first, then Access would not be
able to automatically save the data which you input into your database.

17/05/2020 1
Introduction to Database Shazia Abbasi

Creating Tables
Summary of the Four Steps
Creating a table without the wizard has four main steps…

 Creating the table


 Creating the fields and deciding the data types
 Deciding on a primary key field if needed
 Saving the table
 Deciding the Constraints

Step One - Creating a Table


1. Click Tables button
2. Double click on Create table in design view
Or
1. Click New
2. Click Design View
3. Click OK

Step Two - Creating the Fields and Deciding the Data Type
1. Click into the first row under field name
Click here
to enter
field name2.

3. Type in your first field name, e.g. ICode


4. Press Tab
or
Click into Data Type column
5. If required, click down arrow and change data type (see next page)
6. Press Tab
or
Click into Description column
7. If required, type in a description for this field (e.g. what the field is for!)

17/05/2020 2
Introduction to Database Shazia Abbasi

Access will not allow the following characters in field names:-


. (full-stop) !(exclamation point) [ ] (brackets) ` (grave accent)

It is best practice not to include spaces in field names…


Although you can use spaces in field names and it will not usually cause
problems, it can cause conflicts if you use Visual Basic for Applications with
Access.

Specifying Data Types


You must specify what data type each of the fields in your table should be…

Data Type What does it Extra Information


Example
store?
Holds up to 255 characters.
Firstname
Letters or Most of your fields will probably
Text Lastname
numbers be text.

Holds up to 64,000 characters. It


Letters or is usually used when you need
Memo Comments
numbers to add a lot of text.

Holds numbers which you intend


to sort numerically, or perform
Number Numbers Number of staff
calculations on.

Holds dates which you can then


Date hired sort into date order and perform
Date/Time Dates and Times
Order Date calculations on.

Formats numbers as currency


and allows you to perform
Currency Monetary Values Salary
calculations on those numbers.

Used mostly as a primary key


field, because the number will be
A number which unique for each record. Even if
Access generates the record is deleted the number
AutoNumber ID Number
automatically for goes with it. (Unless the
each record. database is compacted – details
later)

A field which
gives you the Full-Time
Yes/No
choice of 'yes' or
'no'
e.g.

17/05/2020 3
Introduction to Database Shazia Abbasi

OLE objects are


generally graphics, Logo Holds up to 1 gigabyte (limited
OLE Object
e.g. photographs, Product Preview by disk space).
logos
Links to
somewhere else When you click on the data in
that your computer Company web this field it will link you to
Hyperlink
has access to, e.g. site somewhere else.
a word document, a
web site

A field that allows


Lookup Gender
you to choose from
Wizard Department
a drop down list
e.g.

Is phone number a Number data type?


No! For phone numbers, part number, or numbers which you don't intend to do
calculations on the data type is Text! If you choose Number, you will not be able
to have a '0' at the start of your phone numbers!

Step Three - The Primary Key


What is the primary key?
 A special field that uniquely identifies each record in the table. In other
words there is different information in that field for each record, e.g. ID
number, product code.
You could not use something like lastname as the primary key because
people are likely to have the same lastname. The primary key must be
unique to each record.
 It is good practice to identify a primary key for each table, although you do
not have to if you think you do not need one
 If you are creating relationships then there must be a primary key in the
table which is the one side of the relationship

1. Click into the field to become a primary key

2. Click Primary Key icon Key will appear next to field

17/05/2020 4
Introduction to Database Shazia Abbasi

If you do not create a primary key you will be asked about it when
you save the table!
See next section!

Saving the Table


You must save tables before you can input data into them…

1. Click Save button

2. Type a name for the table, e.g. Item


3. Click OK

What should I call my table?


When saving a table it is good practice to identify it as a table in the name, e.g.
Item, OrderMaster, Customer.

If you didn't create a primary key….


…Access will ask you whether you wish to create one when saving

If you say yes, you will end up with an extra field in your table called ID.

17/05/2020 5
Introduction to Database Shazia Abbasi

Create the following Tables

OrderMaster OrderDetail
OrderNo Text SrNo AutoNumber
OrderDate Date OrderNo Text
CCode Text ICode Text

Customer Pending
CCode Text SrNo AutoNumber
CName Text CCode Text
CAddress Text ICode Text
CPhone Text OrderNo Text
OrderDate Date
PQty Number

17/05/2020 6
Introduction to Database Shazia Abbasi

Deleting a Table
There may be occasions when you need to delete a table, however you should only do this if you
really no longer need any of the records it contains! Be particularly careful if the table you are
deleting is related to another table in the database!

1. Click on Tables on the objects bar of the Database window


2. Click on the table you wish to delete
3. Press Delete on the keyboard Access will warn you that you are about to
delete the table

4. Click on Yes

Access will warn you if you the table is related to another table in
the database
If you no longer need the table and the relationship can be deleted, click on Yes
and Access will delete the table and the relationship.

17/05/2020 7

You might also like