Microsoft Office Tutorials and References
In Depth Information
Creating a Database
Book I
Chapter 3
Secret keys
The primary key field for a table doesn’t have to
be information that the user sees. In fact, many
programmers prefer to use a primary key field
that has no use other than to uniquely identify
records. If you create an AutoNumber field
to act as a primary key field, the user of your
database never has to see or type the values
of this field.
When you sign in to the website
to order a book, for example, you never have to
type your customer number. Instead, you sign in
with your e-mail address, and Amazon looks up
your customer number automatically. Similarly,
when you order a book or other merchandise,
you never have to type the item number. You just
find the item you want and then click a button to
add the item to your shopping cart.
Instead, create a table called Constants, Facts, or any name you like with
just one record in it. Create a field for each piece of information you need to
store. Maybe your table contains Our Name, Our Address, Our City, Our
State, Our Zip, and Our Phone Number fields. Be sure to include an
Our State Sales Tax field, too. Wherever you want this information
to appear (mainly in reports), Access can look it up in your table. Then, if
something changes (such as your telephone area code), you have to update
it in only one place!
Creating a Database
Okay, if you’ve been faithfully reading this topic every night before bedtime —
doesn’t everybody? — you’re 60 pages or so in by now. If you still haven’t
created your database, enough, already! You’re armed with your database design,
and you’re ready to start. (If you haven’t been following along, maybe you’d
better review those 60 pages before you start.)
When you set out to create a new Access database, you have two options:
Create it from scratch, or use a template. We discuss both options in the
following sections.
Creating a database from scratch
After you have a beautiful database design (allow us to recommend the —
ahem! — stellar example in this chapter), you can start with a blank
database and create the tables, fields, and relationships, which means running
Access without opening an existing database. Follow these steps:
Search JabSto ::

Custom Search