How to display a picture by using an Access database in FrontPage 2003 (825515)



The information in this article applies to:

  • Microsoft Office FrontPage 2003
  • Microsoft Office Access 2003

For a Microsoft FrontPage 2002 version of this article, see 318813.

For a Microsoft FrontPage 2000 version of this article, see 216285.

SUMMARY

This article describes how to display images on your Web site by using information from a Microsoft Access database.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. back to the top

Prerequisites

Install components before you use the ASP features in FrontPage

Before you can use the Microsoft Active Server Pages (ASP) features in Microsoft Office FrontPage 2003, you must install the components that are listed in Microsoft Knowledge Base article 825487. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

825487 How to query Index Server data by using ASP in FrontPage 2003

Install FrontPage 2003 and Access 2003

The steps in this article require that you have Microsoft Office FrontPage 2003 and Microsoft Office Access 2003 installed on the client computer. FrontPage 2003 and Access 2003 are included with Microsoft Office 2003.

back to the top

Create a new personal Web site

To create a new personal Web site, follow these steps:
  1. Start FrontPage.
  2. On the File menu, click New.
  3. In the New task pane, click More Web site templates.
  4. In the Web Site Templates dialog box, click Personal Web Site.
  5. In the Specify the location of the new Web site box, type the URL of a new personal Web site on a Web server that supports Active Server Pages, such as:

    http://mywebserver/mypersonalweb/

  6. Click OK to create the Web site.
back to the top

Add the sample database to the Web site

To add the sample database to the Web site, follow these steps:
  1. Click Create a new normal page on the toolbar.
  2. On the Insert menu, point to Database, and then click Results.
  3. On the first page of the Database Results Wizard, click Use a sample database connection (Northwind), and then click Next.
  4. Click Cancel.
back to the top

Modify the Employees table in the database

To modify the Employees table in the database, follow these steps:
  1. On the View menu, click Folders.
  2. Double-click the fpdb folder, and then double-click the fpnwind.mdb file to open the file in Access.
  3. Double-click the Employees table to open it.
  4. On the View menu, click Design View.
  5. At the end of the table, click in the first blank row to add a new field to the table.
  6. Configure the new field as follows:
    1. In the Field Name column, type FavoriteImage.
    2. In the Data Type column, click Text.
  7. On the File menu, click Save.
  8. On the View menu, click Datasheet View.
  9. Type the following values in the FavoriteImage row for each of the employees:
    EmployeeFavoriteImage
    Nancy Davolioimages/mycat.jpg
    Andrew Fullerimages/mount.gif
    All other employeesimages/parrot1.jpg
  10. To close the database and to return to FrontPage, click Exit on the File menu.
  11. On the View menu, click Refresh.
back to the top

Add a Database Results region

To add a Database Results region, follow these steps:
  1. On the View menu, click Page.
  2. On the Insert menu, point to Database, and then click Results.
  3. Follow these steps in the Database Results Wizard:
    1. In the list of existing database connections, click Sample, and then click Next.
    2. In the Record source list, click Employees, and then click Next.
    3. Click Edit List.
    4. Remove all fields except for the following fields:
      • LastName
      • FirstName
      • FavoriteImage
    5. Click OK.
    6. Click Next two times, and then click Finish.
  4. On the File menu, click Save.
  5. Type imagetest.asp in the File name box, and then click OK.
back to the top

Add the image links to the database results

To add the image links to the database results, follow these steps:
  1. Click the <<FavoriteImage>> value in the FavoriteImage column, and then press DELETE.
  2. In the table cell where you just removed the <<FavoriteImage>> value, insert the Mycat.jpg image from your Web site. To do this, follow these steps:
    1. On the Insert menu, point to Picture, and then click From file.
    2. Locate the Mycat.jpg image in the Image folder of your Web site.
    3. Click the image, and then click OK.
  3. Right-click the image, and then click Picture Properties.
  4. Click the General tab.
  5. Click Parameters.
  6. In the Path box, remove the current path.
  7. Click Insert Field Value, and then click FavoriteImage.
  8. Remove the quotation marks from the start and end of the field value.
  9. Click OK two times. You see a small, broken image icon in the table column.
  10. Save the page, and then click Preview in Browser on the toolbar.
back to the top

REFERENCES

For more information about how to work with databases in FrontPage , click Microsoft Office FrontPage Help on the Help menu, type databases in the Search for box in the Assistance pane, and then click Start searching to view the topic.

back to the top

Modification Type:MinorLast Reviewed:1/6/2006
Keywords:kbgraphic kbhowto KB825515 kbAudEndUser