Online Book Reader

Home Category

Access Cookbook - Ken Getz [304]

By Root 2019 0
Connection to Use and tblRegister under Table to hold form results.

Under URL of confirmation page (optional), enter "confirm.asp".

Click the Saved Results tab and modify each field so that it maps to the fields in tblRegister according to Table 15-2:

Table 15-2. Mapping the form fields to tblRegister fields

Form field

Database column

txtAge

Age

txtFirstName

FirstName

txtLastName

LastName

txtSex

Sex

Click OK to dismiss the Options for Saving Results to Database dialog box and OK to dismiss the Form Properties dialog box.

Change the heading of the page to "Registration Form" and replace the introductory text on the form with "Please register by completing the following form."

Select File → Save to save the changes you have made to the register.asp page.

Select File → Preview in Browser to display the page in your browser. The page should look similar to the one shown in Figure 15-17. Enter data into each of the fields and click Submit Form.

Figure 15-17. The completed registration page

Open the 15-05.MDB database to verify that the data was added to the tblRegister table.

Discussion


You don't need to use the Form Page wizard to connect a form to an Access database. If you'd prefer to setup the form yourself, go ahead and create the form, skipping steps 9-15 of the solution. The remainder of the solution, however, should still apply.

If you don't have an existing Access database to work with, you can have FrontPage create a new one for you. From the Options for Saving Results to Database dialog box (see Step 21), click on the Create Database... button to create a new database. FrontPage creates a new database and hooks the form up to a table in the database named Results.

The steps in this solution apply when using FrontPage 2003. However, except for some trivial differences, the steps are virtually identical when using FrontPage 2002.

See Also


See Database Power with Microsoft FrontPage version 2002. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_fp2003_ta/html/odc_fpbldgxmlwebs.asp

15.6. Create a Web Frontend to an Access Table Using FrontPage


Problem


While SharePoint is amazing, it has several limitations. First, it requires a server running Windows 2003 server and Windows SharePoint Services. In addition, the Data View Web Part is read-only and provides no mechanism for updating the data. Is there a way to use FrontPage to create a web frontend to your Access data without employing SharePoint?

Solution


You can use the FrontPage Database Interface Wizard to create a complete web site that lets you view and edit data from a database table. The trick in this solution is to create the database connection before running the wizard. Follow these steps to create a web site based on the tblAlbums table from the 15-06.MDB database:

WARNING

This solution will not work with a SharePoint-enabled web site.

Startup FrontPage 2003.

Select Select File → New... to create a new web site. On the New task pane, click on "One page Web site..." under New Web site.

At the Web Site Templates dialog box click on Empty Web Site and enter the following location for the Web site:

http://localhost/15-06

FrontPage creates a new empty Web site on the current machine. If you do not have a Microsoft web server running on the current machine, you will need to change localhost to the name or address of a Microsoft web server for which you have site creation privileges.

Select File → Import. Click on Add File... from the Import dialog box.

Navigate to the 15-06.MDB sample database and click Open. Click OK to add the database to the site.

When you click OK, FrontPage recognizes that you are importing a database and asks you if you wish to create a database connection for the database.

Enter "15-06" for the database connection name and click Yes to import the database and create the database connection.

FrontPage displays an additional dialog box suggesting that the database be moved to the fpdb folder. This is a good practice

Return Main Page Previous Page Next Page

®Online Book Reader