Database: Access: Creating a new database
Before starting, you should have a good idea of what you want in each table.
- Create database. After starting MS Access, you will get a dialog box. Select the top
radio button ("Blank Access database"), and click OK (or Cancel and
select File > New).
Microsoft Access databases have a
.mdb
extension. Choose
a name for it and save it somewhere you can get it later.
- Create table.
You will then see a Database Window like the following:
Because we're only going to deal with SQL, the only two elements
along the left side that you need to use are Tables and Queries.
For the purposes of these notes you can ignore Forms, Reports, Pages,
Macros, Modules, Groups, and Favorites.
You will come back to the Database Window continually, since
the new tables (queries, ...) that you create will be listed here.
- Use design view. Click on "Create Table in Design View". Design View is used to
create the fields that we'll have in a table.
Data View will be used later to enter data into the table.
- Define fields. The design view that comes up has three columns. Fill them in.
- Field Name. Type a field name here (no blanks or special characters).
- Data Type. Select the appropriate data type.
- Description. These are comments for you. If the names are very
clear, you can leave this blank. If there is anything
special about a field, document it here.
- Indicate primary key. Choose a primary key by right clicking the field or
selecting the field and clicking the key on the toolbar.
- Save the design view. Save the table and give it a good name (plural noun is good).
Close the design view window, and you'll be back at the dialog above, but one
important difference - your new table will be listed in the right pane.
- Data view. In the Database Window double click the table name
that you just created, or right click
it and select Open. This data view will let you enter data for each of the fields.
You can easily switch between design and data view with the leftmost toolbar icon.