Microsoft Office Tutorials and References
In Depth Information
Designing a Database
Naming things (for serious database designers)
If you really want to impress your
programming friends, consider using prefixes on all
your object names to show what kind of object
you’re naming. Here’s a set of commonly used
prefixes:
tbl Table
qry Query
frm Form
rpt Report
mcr Macro
bas Module
You might rename the Products table
tblProducts, for example.
Fewer programmers use prefixes for fields to
show the data type of each field. If you want
to, and if you want to read more about the
Leszynski naming convention from which these
prefixes come, go to http://mvps.org ,
and search for “Leszynski naming convention.”
Cleaning up the design
You have tables, you have fields, and you have relationships. What more
could you want in a database design? You’re almost done. Look at each field
in each of your tables, and decide on the following for each field:
Data types: The section “Data types,” earlier in this chapter, describes
the types of information you can store in Access fields. Decide what kind
of information each field contains, how large your Text fields need to be,
and what kinds of numbers your Number fields hold. (Book II, Chapter
2 explains the sizes of Number fields.) Make sure to use the same data
type and length for related fields. If ProductID is a Text field that’s 16
characters long in the Products table, make it the same length in the
Order Details table.
If you use an AutoNumber field as the primary key in a master table, use
a Long Integer Number field for the foreign key in related tables.
Required fields: You can tell Access not to allow a field to be blank. A
record in the Products table should never have a blank ProductID or
Price field, for example.
Validation: You can set up validation (data checking) rules for fields, as
described in Book II, Chapter 5. Think about limits on the legal values
for the field. You may want to specify that value in the Price field of the
Products table can’t be more than $1,000 or that the value in the Pounds
field must be less than 200. (This rule should work unless you’re selling
some really heavy stuff.)
 
Search JabSto ::




Custom Search