Building a Mailing List with Borland Delphi - The Database
(Page 2 of 5 )
It is up to you as to how much information about a contact you want to store in the database. In our database, we are only going to store the name, email address and group ID of a contact.
Start up MS Access and create a new database called "mailinglist." Then create a table called contacts. This table will have the following four fields:
Field Name | Data type |
eid | Autonumber (primary key) |
name | text |
email | text |
gid | number |
The eid field will generate a unique number for each new contact that is created. This is important because we are going to use this number to identify the contact when it has to be placed in a group. The only other field that I think needs explaining is the "gid" field. This field will identify the group to which the contact belongs. If a contact does not belong to any group, this field will contain a zero. Below is a screen shot of the contacts table in design view:

The next table we need to create is the groups table. This table will only contain two fields:
Field Name | Data type |
groupID | Autonumber (primary key) |
groupname | text |
Below is a screen shot of the groups table in design view:

Next: Building the GUI for the Application >>
More Delphi-Kylix Articles
More By Leidago