Access is a relational database, so it consists of tables that may share fields (links). Your tableswill hold objects from a given class, therefore must have a field for each of the member data items of that class.
| When you start Access, you will see the dialog at the right. If you want to reopen a database, you can select it from the list at the bottom of the dialog. Choose blank database otherwise. | |
| Next you will have to save your data base using a standard save dialog. | |
| When you design a new table, select the Table tab and click the new button. In the dialog that appears, select design view. | |
In this case you will build a table to hold objects from the class Professor shown below. Notice there is one field for each of the data members of the class (named with exactly the same name except for underline at the begining). The first field is the key field. It is an integer generated by the database (AutoNumber) that identifies the item uniquely. It is used if you want to link objects in this class to other objects (say course offerings). Notice the types of the database fields correspond to the types of the data members.
class Professor
{
public:
// Functions not shown here
private:
String _lastName;
String _firstName;
String _initial;
String _office;
String _phone;
int _rank;
};
|
|