eCommerce Database

Once you have saved your starting eCommerce Database, it is time to set it up for your web site. Start Microsoft Access and at the opening dialog check that "Open an existing file" and "More Files..." are selected and then click OK. Navigate to your eCommerce file and open it. This is what you should see (XP colors will be different in Windows 98 or Windows 2000):

This database starts out empty, and we will create a table in Design view to hold the order data. Double-click on "Create table in Design View." Design View is shown below.

Order_Number will be the first field, and we will have the order number generated automatically by the database. Type the Field Name, select the Data Type from the drop-down list box, and type the Description (this is an excellent way to document your fields). Next, we will make Order_Number the primary key for the database, so that order numbers can be searched for quickly. Use the "Primary Key toolbar button (shown below) to do this.

 

The result is shown below:


Primary key icon shown on this field...


... and will increment (count up by one) automatically, with no duplicates allowed
(just what we need for an order number)

Next the date and time of the order:

Work on entering the rest of the fields. Names, email addresses and so forth will typically be text fields. The zip code should be a number so that it can be sorted on for mailings (business get a deal on postage if they bring mail in pre-sorted). Dollar figures should be currency with two decimal places, as shown below.

The order of the fields in the database can be important. In using the simplified confirmation page and email confirmation methods in theASP page, the display order for the fields will be their order in the database. You can change field order in Design View by clicking on a row to select it, and then using Drag 'N Drop to move it.

When you are finished setting up your fields, click on the Design View close box in the upper right corner of the Design View window. You will be asked whether you want to save the design changes (Yes), and if so, then what should the table name be (must match recordset Open in ASP page - I suggest naming the table "Orders," as shown below).

Now you will see your new table listed in the Database View.

If you double-click on the new table (it is always to double-click the icon, not the letters), you will open the database in Table View and see the fields. When orders have been placed, you will see each order as a single record or row.

But for now, close Access and FTP the database back to your "Dum" folder.