In This Site

Home
Free News Updates
Using Microsoft FrontPage
Cascading Style Sheets
Database Fundamentals
FrontPage & Access
FrontPage Navigation
Website Security
Solving Problems
Learning SQL
Code Samples
Promote Your Site

In This Section

Up
Adding Records
Editing/Updating Records
Deleting Records

The number one source for making your website sell!

 

 

 

 

FrontPage Tips by Ward Cameron Enterprises
Take Your Web Site to New Levels

Using FrontPage's DRW to Add Records To A Database

This tutorial will give you a simple way to add a record to a database using a simple web form. FrontPage is an excellent tool for adding data to a web site, and later retrieving that data to display in a web page.

Adding records to a database requires only a few basic steps. You need the following components:

  1. A working database. FrontPage can create the database for you, but it is always preferable to create the database yourself, and then import it to your FrontPage web. This gives you much more flexibility in the database design and the table structure. Click here to learn how to import a database to FrontPage.
  2. A form that will add the data to the database. Click here to learn how to create a FrontPage form.
  3. Optional custom confirmation page. Once the data has been entered, you can create a custom page that will be displayed to confirm that the data has been added and to offer additional options.
The process involves several steps
1. Create the Database Form
2. Add the Page to the Database
3. Create A Custom Confirmation Page

Once you have a database created and a have a working database connection, you are ready to begin adding data to your database. First, try a simple Database Results Wizard to provide a good test for your database connection. If you can't display some simple data, than you will not likely be able to add data to your database either.

First walk, then fly.

Step 1 - Create The Database Form

In order to add data to your Access database, you'll first need to create a form. The form will contain all the fields that you want to add to your database table. You should use an Auto Number Field as the key for your table to provide a bomb-proof way to avoid duplicate key value.

Like our other examples, we'll use the Northwind Database that came with Microsoft Access.

Once you have created your form, you need to set the form properties. This is how you will send the data to Microsoft Access. The following form is a sample Customer form that could be used to add data to the Customers table in the Northwind Database.

[FrontPage Save Results Component]

Sample Contact Form

Customer ID:
Company Name:
Contact Name:
Contact Title:
Address:
City:
Region:
Postal Code:
Country:
Phone:
Fax:
   

This is a sample form only - It is not designed to actually add data to the database

I usually use a table to help me organize the fields better. I could have used a drop-down list for the Region or Country.

As a general rule, it is often easier to use text fields in your Access table for any field that will not need calculations performed. Phone numbers, Zip Codes and other number data can be easily contained in text fields.

Step 2 -  Add the Page to the Database

Now, right Click the form and select Form Properties. The following screen will appear:

Select "Send to database" and click the "Options" button. This is where you will cement the connection between the form and the database. Here is the first tab of the Options screen.

Select the Northwind connection from the Database Connection list and then the Customers table in the "Table to hold form results" drop-down. Now select the "Saved Fields" tab:

In this screen, you'll need to match each field on the form with the corresponding Database Column field. Double click each field in turn to open the Modify Field dialog. Match the Form Field name with the matching name in the "Save to database column" drop-down list.

Once you have matched all of the fields, you have the option of adding additional fields in the "Additional Fields" tab:

This screen allows you to record the users Browser Type, Remote computer name, Timestamp and their user name. Remember, if you want to track any of these items, you'll need to first open the table in access and add a field value to hold the data.

Finally, click OK and publish your web. Now you can try it out and see if it works.

There are many things that can go wrong. Start simply and save any complex formatting for later. Once your form works perfectly, than you can take the time to format it to make it more visually appealing.

Step 3 - Create a Custom Confirmation Page

When you submit form data, the data is entered into the database form, and then you are taken to a confirmation page. FrontPage automatically produces a simple confirmation page, but it is usually advised that you create a custom confirmation page.

A custom confirmation page is a simple page onto which you put any text you want to be displayed when a user submits the data. You then add confirmation fields onto the page. Select Insert-Web Component, and scroll to the bottom of the list for the Advanced Controls. Select Confirmation Field from the "Choose a control" screen and click Finish

In the Confirmation Field Properties screen, type the name of the field exactly as it will appear in the database.

You will see the following appear on your web page:

CustomerID

When the custom confirmation page is loaded, the field name will be replaced by the actual Customer ID. You can add a confirmation field for all fields that you want displayed to the user upon data entry.

Once you've created the page, go back to the form properties and enter the url in the Custom Confirmation Page field. Now when you submit the form, the custom confirmation page will be displayed.


These tutorials are part of an upcoming training course called "FrontPage Magic - How To Create A Database Driven Website For Non-Programmers". Stay tuned for more details on this exciting new product.

Send your tips to .
All materials Copyright © Ward Cameron All Rights Reserved