Skip to the content
Cal State L.A. logo
ITS logo

Menu

Internet Technology

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:

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

  1. Launch FrontPage Icon Microsoft FrontPage.
  2. Open your web directory on the Instructional Web Server by selecting Open Web from the File menu.

    Select Open Web from the File menu

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

    Type Web Directory URL in web name: box

  4. Click on the Open button.
  5. 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.

    Type in your NIS username and password

  6. 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).
  7. Display the folder list by selecting Folder List from the Views menu (skip this step if your folder list is already being displayed).

    Select Folder List from the Voew menu

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

    Form Properties Window

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

    Form Options

  12. 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.

    Database successfully created message

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

    Change file extension to .asp warning

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

    Select Save As from the File menu

  18. In the Save As text box, change the .htm extension to .asp.
  19. 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.

  1. Open FrontPage Icon Microsoft FrontPage.
  2. Open your Web Directory on the Instructional Web Server (see steps 2-5 above).
  3. Display the folder list by selecting Folder List from the Views menu (skip this step if your folder list is already being displayed).

    Select Folder List from the Voew menu

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

    Expand the fpdb folder to open the database file

  5. Double-click the file to open it. Microsoft Access will launch.
  6. 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:

  1. Create a simple HTML web page with the confirmation message you would like displayed.
  2. Save this new confirmation page into your Instructional1 web directory.
  3. Open the web page containing your form.
  4. Right click one of the form fields and select Form Properties... from the shortcut menu that appears.
  5. Click on the Options... button in the Form Properties window.
  6. The last two boxes at the bottom of the window allow you to insert your own confirmation page and an error page.
  7. Insert the filename (complete with extention) of your confirmation page into the optional URL of confirmation page box.
  8. Click on OK to close the Options window..
  9. Click on OK to close the Form Properties window.
  10. 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.


5151 State University Drive . Los Angeles . CA 90032 . (323) 343-3000
© 2008 Trustees of the California State University
Last Update: 08/26/2008
Contact the Page Author