FP2002: HOW TO: Display a Picture with Hyperlink by Using an Access Database (323033)



The information in this article applies to:

  • Microsoft FrontPage 2002

This article was previously published under Q323033

SUMMARY

This step-by-step article describes how to make images that are a part of database results into hyperlinks by using addresses from the same database. Additionally, this article describes how to display hyperlinked images on your Web site by using information from a Microsoft Access database.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

Step 1 - Prerequisites



Before you can use the ASP features in Microsoft FrontPage 2002, you must install the components that are listed in the following Microsoft Knowledge Base article:

318287 FP2002: What You Need to Use Active Server Pages (ASP) in FrontPage 2002

Important The steps in this article require that you have both Microsoft FrontPage and Microsoft Access installed on the client computer.

back to the top

Step 2 - Create a New Personal Web

To create a new personal Web, follow these steps:
  1. Start FrontPage.
  2. On the File menu, point to New, and then click Page or Web.
  3. In the New Page or Web task pane, click Web Site Templates.
  4. Click the Personal Web template, and then type the URL of a new personal Web on a Web server that supports Active Server Pages, for example, http://localhost/mypersonalweb/
  5. Click OK to create the Web.
back to the top

Step 3 - Add the Sample Database to the Web

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

Step 4 - Modify the Employees Table in the Database

To modify the employees table in the database, follow these steps:
  1. Open the Web that you created in FrontPage.
  2. On the View menu, click Folders.
  3. Double-click the fpdb folder.
  4. Double-click the fpnwind.mdb file to open the file in Microsoft Access.
  5. Double-click the Employees table to open it.
  6. On the View menu, click Design View.
  7. Add two new fields after the last field:
    Field Name          Data Type
    --------------------------------
    Hyperlink           Text
    FavoriteImage       Text
    
  8. Name one field Hyperlink, name the other field FavoriteImage, and then set the data type to Text.
  9. Click Save.
  10. Click the View menu, and then click Datasheet View.
  11. Type the following information in the two new fields:
    For Employee             In the Hyperlink field     In the FavoriteImage field
    --------------------------------------------------------------------------------
    EmployeeOne              http://www.msn.com         Images/Mycat.jpg
    EmployeeTwo              http://www.msnbc.com       Images/Mount.gif
    All remaining employees  http://www.microsoft.com   Images/Parrot1.jpg
    	
  12. Save your table, and then close Access.
back to the top

Step 5 - Add a Database Results Region

To add a database results regions, follow these steps:
  1. Switch to FrontPage, and then on the View menu, click Page.
  2. On the Insert menu, point to Database, and then click Results.
  3. In the list of existing database connections, click Sample, and then click Next.
  4. For the record source, click Employees, and then click Next.
  5. Click Edit List, and then remove all fields except for the following:

    LastName
    FirstName
    FavoriteImage
  6. Click OK, and then click Next.
  7. Click Next again, and then click Finish.
  8. Name the page Imagetest.asp, and then save the page.
back to the top

Step 6 - Add the Image Links to the Database Results

To add the image links to the Database Results, follow these steps:
  1. Locate the column value that has the name <<FavoriteImage>> in the Database Results region, and then delete the column value.
  2. In the table cell where you just removed the column value, insert the Mycat.jpg image from your Web.
  3. Right-click the image, and then click Picture Properties.
  4. Click the General tab, and then click Parameters.
  5. In the path field, remove the current path, click Insert Field Parameter, and then click FavoriteImage.
  6. Click OK, and then click OK again. Note that you will see a small broken image icon in the table column.
back to the top

Step 7 - Hyperlink the Images

To hyperlink the images, follow these steps:
  1. Right-click the broken image.
  2. Click Hyperlink, click Parameters, and then remove the whole path that currently exists.
  3. Click Insert Field Value, select the field that contains the Web address, click OK, and then click OK again.
  4. Save the page.
back to the top

REFERENCES

For more information about how to work with databases in FrontPage, click Microsoft FrontPage Help on the Help menu, type databases in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For additional information about what you require to use ASP in FrontPage 2002, click the following article number to view the article in the Microsoft Knowledge Base:

318287 F002: What You Need to Use Active Server Pages (ASP) in FrontPage 2002

back to the top

Modification Type:MinorLast Reviewed:1/6/2006
Keywords:kbHOWTOmaster KB323033