Connecting a Web Form to a Database on the Instructional Web Server
Online Surveys are often conducted through the submission of a web form. The following instructions will show you how to store data from a web form into a Microsoft Access Database.
Prerequisites:
- Familiarity with Microsoft FrontPage
- Knowledge of HTML, Forms in particular
- An account on the Instructional Web Server (IWS)
- An existing web form
If you would like to learn more about MS FrontPage and the process of creating a web form, visit the ITS Documentation site or run FrontPage and press F1 for help. When asked "What would you like to do" in the FrontPage help section, type "creating a form" to view a list of resources and instructions.
Preparing your form
The database that gets created will contain column names based on the names of the Form Fields in your web form. It is highly recommended you name all your form fields to something you can easily identify. For example, would you rather have a column named "T23" or "Zip_Code"?
To rename a form field, double click the form field to open its Properties box (or right click the field and select Form Field Properties...). Replace the name in the Name: box to a more appropriate name. Please note that names cannot contain spaces or hyphens.
Connecting your form to a database
- Launch
Microsoft
FrontPage. - Open your web directory on the Instructional Web Server by selecting
Open Web from the File menu.

- Type the URL for your web directory into the Web name:
text box
(i.e. http://instructional1.calstatela.edu/jsmith).

- Click on the Open button.
- Type your NIS username and password to gain access to the web directory.
You will need to type in your username with the NIS\ prefix. Check the Remember
my password check box if you don't want to be prompted to login again.

- Click OK to login if you haven't already. Depending on your computer and network speed, it may take a couple of minutes to login. FrontPage will refresh itself once you login successfully (depending on your current views, your screen may change).
- Display the folder list by selecting Folder List from the
Views menu (skip this step if your folder list is already being
displayed).

- Open the web page containing your web form by double-clicking the filename in the Folder List.
- Right click one of the form fields and select Form Properties...
from the shortcut menu. The Form Properties window will open.

- Select the Send to database radial button.
- Click on the Options... button on the lower left
side of the window.

- Press the Create Database... button to create a
database for your web form. A window will pop up once the database has been
created. Please note the database filename and the location of the database
file.

- Click OK to close the window.
- Click on OK to exit the Options for Saving Results window.
- Click on OK to close the Form Properties window.
- FrontPage will pop up a message stating that your web form must have a ".asp"
extension. Click Ok to close the pop up.

- To change the file extension, select Save As...
from the File menu.

- In the Save As text box, change the .htm extension to .asp.
- Click on the Save button.
View the Database Results
To view the results from the form submissions, you will need to open the MS Access Database file. This file MUST be opened from within the FrontPage application.
- Open
Microsoft
FrontPage. - Open your Web Directory on the Instructional Web Server (see steps 2-5 above).
- Display the folder list by selecting Folder List from the
Views menu (skip this step if your folder list is already being
displayed).

- Find the folder called fpdb and expand it. You will see
an Access Database file named after the web page containing your web form.

- Double-click the file to open it. Microsoft Access will launch.
- The file will contain a Results table with all the form submissions. Double click the table to view the submitted results.
Inserting your own Confirmation Page
Once your web form is connected to a database, FrontPage automatically produces a generic confirmation page everytime a user submits the form. This automated confirmation page displays the answers a person has submitted along with a link back to the web form. This can be confusing to some people as there is no real indication that the process is complete, nor that the information was saved. Most authors like to replace this page with their own confirmation page thanking a user for submitting the survey.
"Your answers have been saved, thank you for taking the time to fill out this survey."
This or a similar message are often preferred and clearer than the default page produced by Microsoft FrontPage.
If you would like replace the confirmation page with your own web page and message, do the following:
- Create a simple HTML web page with the confirmation message you would like displayed.
- Save this new confirmation page into your Instructional1 web directory.
- Open the web page containing your form.
- Right click one of the form fields and select Form Properties... from the shortcut menu that appears.
- Click on the Options... button in the Form Properties window.
- The last two boxes at the bottom of the window allow you to insert your own confirmation page and an error page.
- Insert the filename (complete with extention) of your confirmation page into the optional URL of confirmation page box.
- Click on OK to close the Options window..
- Click on OK to close the Form Properties window.
- Save your web page.
The form will now go to the pages you specified when it is submitted. The submitted data will be saved to the database file before displaying the confirmation page.


