Microsoft KB Archive/323033

= FP2002: HOW TO: Display a Picture with Hyperlink by Using an Access Database =

Article ID: 323033

Article Last Modified on 2/1/2007

-

APPLIES TO


 * Microsoft FrontPage 2002 Standard Edition

-



This article was previously published under Q323033





IN THIS TASK

 * SUMMARY
 * MORE INFORMATION
 * Step 1 - Prerequisites
 * Step 2 - Create a New Personal Web
 * Step 3 - Add the Sample Database to the Web
 * Step 4 - Modify the Employees Table in the Database
 * Step 5 - Add a Database Results Region
 * Step 6 - Add the Image Links to the Database Results
 * Step 7 - Hyperlink the Images
 * REFERENCES

back to the top



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:

https://partner.microsoft.com/global/30000104

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

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:  Open the Web that you created in FrontPage. On the View menu, click Folders. Double-click the fpdb folder. Double-click the fpnwind.mdb file to open the file in Microsoft Access. Double-click the Employees table to open it. On the View menu, click Design View.</li>  Add two new fields after the last field: <pre class="fixed_text">Field Name         Data Type

Hyperlink          Text FavoriteImage      Text </li> Name one field Hyperlink, name the other field FavoriteImage , and then set the data type to Text.</li> Click Save.</li> Click the View menu, and then click Datasheet View.</li>  Type the following information in the two new fields: <pre class="fixed_text">For Employee            In the Hyperlink field     In the FavoriteImage field

EmployeeOne             http://www.msn.com         Images/Mycat.jpg EmployeeTwo             http://www.msnbc.msn.com       Images/Mount.gif All remaining employees http://www.microsoft.com   Images/Parrot1.jpg </li> Save your table, and then close Access.</li></ol>

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


 * 1) Click OK, and then click Next.
 * 2) Click Next again, and then click Finish.
 * 3) 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

<div class="references_section">