Database Reference
In-Depth Information
one for all
the fields in the Rep table and the other for all the fields in the Customer table, except for the RepNum field.
You will not include the RepNum field in the user-defined data type for the Customer table because you will
need to enter it separately to be able to use it as a lookup field to relate the Customer and Rep tables in the
Web database.
The following steps create two user-defined data types in the User Defined Types category
1. Start Access and open the Premiere Products database from your Data Files.
2. Open the Rep table in Datasheet view.
3. Click the column heading for the RepNum field to select the field, press and hold the Shift key,
click the column heading for the Rate field, and then release the Shift key to select all the fields
in the Rep table.
4. Click the More Fields button (Table Tools Fields tab | Add & Delete group) to open the More
Fields gallery.
5. Click the Save Selection as New Data Type command to open the Create New Data Type from
Fields dialog box.
6. In the Name box, type Rep Fields.
7. Press the Tab key to move to the Description box, and then type All fields in the Rep table.
Notice that the default Category is already set to User Defined Types.
8. Click the OK button to save the data type. After a few seconds, Access opens a dialog box to tell
you that the template (your user-defined data type) has been created, and gives the location
where it has been stored.
9. Click the OK button.
10. Click the More Fields button (Table Tools Fields tab | Add & Delete group), and then scroll to
the bottom of the More Fields gallery. The Rep Fields data type appears in the User Defined
Types section.
11. Press the Esc key to close the gallery, and then close the Rep table.
376
After creating a user-defined data type, it is stored on the user
'
s hard drive so it is available for future use.
1. Open the Customer table in Datasheet view, and select all fields except for RepNum.
2. Create a user-defined data type named Customer Fields and with the description of All fields in
the Customer table except RepNum.
3. Save the data type in the User Defined Types category, and then close the dialog box that indi-
cates that the template was created.
4. Click the File tab on the Ribbon, and then click the Close Database command to close the
Premiere Products database without exiting Access.
CREATING A WEB DATABASE
You create a Web database using a template, similar to the way you create a regular database. Because the
Web database must be compatible with a Web browser and Internet protocols, there are limitations in the
Web database with regard to how you create and interact with its objects. For example, you cannot use
Design view when creating a table, so you must create the table in Datasheet view. Although you can change
the default field name of the primary key created in a table, you cannot change its default data type
(AutoNumber). If your table design uses a Text field as its primary key, you can specify that the Text field
must be both required and unique to work around the fact that you must accept the default AutoNumber
field as your table
s primary key. You also cannot create relationships between tables as you do in a regular
database; instead, you specify relationships using lookup fields.
You
'
'
ll create the Web database using the Blank web database template shown in Figure E-11.
Search WWH ::




Custom Search