It is
here that we create, modify and remove joins. The relationship is given a default
name, which we can change; we need only define the tables involved, together
with the "direction" of the join, using the Primary key and Foreign
key fields in the middle section of the tab.
Several
other settings are maintained here, as well, allowing us to dictate the join
behaviors that are appropriate to our business needs in the database. The "Enforce
relationship" checkboxes, both checked in our example, as shown above,
enforce referential integrity for the relationships under consideration.
18.
Close the Properties
dialog when desired.
Now
that we have a basic database diagram for our MSSQL Server database, let's
explore ways to deliver / store the information it contains.
Consider
Distribution Options for the Diagram
In addition to the
capability to print the diagram we have created (both via icon or menu item, as
in most Windows applications), we can save it using the Save As ... menu
item or icon to save our work with a new name. Let's save our diagram with the
following steps.
1.
Select File
--> Save As ... from the main menu.
The Save
As ... dialog appears.
2.
Type the
following into the ... To box:
PubsDataDictionary
The completed
Save As ... dialog appears as shown in Illustration 18.
Illustration 18: The
Completed Save As ... Dialog
3.
Click OK
to save the diagram as specified.
Conveniently
enough, the diagram can be embedded in various MS Office applications' files,
as well, including Visio, Word, Excel, Outlook, FrontPage,
and others. We will demonstrate this with the following steps:
4.
"Lasso"
the diagram using the mouse, as shown (reduced) in Illustration 19.
Illustration 19: Select
the Database ...
NOTE: Selecting Edit --> Select All from the main menu will
accomplish the selection of the complete diagram, as well.
5.
Select Edit
--> Copy to Clipboard from the main
menu.
6.
Open a new
document in MS Word.
7.
Click the
document at any point.
8.
Select Edit
--> Paste from the main menu.
The database
diagram appears in the MS Word document, ready for saving, e-mailing,
further documenting the database, etc.
The
capability to embed our new database diagram into other office documents
widens our distribution and publication capabilities immensely. Documentation
becomes a breeze with the availability of these features in an integrated MS
Office documentation effort.
9.
Close the MS
Word document, saving it as desired, and return to the database diagram
in MS Access.
10.
Select File
--> Close from the main menu, saving the
diagram if prompted.
We
return to the Database Diagrams list, where we see our new diagram
listed, where we can readily access it at a future date, as depicted in Illustration
20.
Illustration 20: Our New
Diagram Appears in the Database Diagrams List
11.
Close the MS
Access Project (.adp file) when desired.
Conclusion ...
In this
article, we discussed potential uses for database diagrams in general,
and then established a hypothetical business need for such a diagram. We
established connectivity with our targeted MSSQL Server database, once we had
created an MS Access Project (.adp file) within which to perform
our practice exercise. We then began our creation of a database diagram.
Within
our practice example, we noted the "automatic" nature of much of the
process, particularly in the case of a simple database like our target, the pubs
sample. We discussed join / relationship creation and maintenance, even
though the joins were created as part of the basic diagram generation within
our practice exercise. We then discussed navigation and various aspects of
managing our diagram, finally concluding with comments and practice surrounding
the distribution of our database diagrams within the MS Office application
family.
»
See All Articles by Columnist William E. Pearson, III