FP2002: HOW TO: Display a Picture with Hyperlink by Using an Access Database (323033)
The information in this article applies to:
This article was previously published under Q323033 SUMMARYThis
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 INFORMATIONMicrosoft 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 -
PrerequisitesBefore 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
topStep 2 - Create a New Personal
WebTo
create a new personal Web, follow these steps: - Start FrontPage.
- On the File menu, point to New, and then click Page or Web.
- In the New Page or Web task pane,
click Web Site Templates.
- 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/
- Click OK to create the Web.
back to the
topStep 3 - Add the Sample
Database to the Web
To add the sample database to the Web, follow these steps: - Click the Create a new normal page
button on the Standard tool bar.
- On the Insert menu, point to Database, and then click Results.
- Click Use a sample database connection
(Northwind), and then click Next.
- Click Cancel.
back to the topStep 4 - Modify the Employees
Table in the DatabaseTo
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.
- Add two new fields after the last field:
Field Name Data Type
--------------------------------
Hyperlink Text
FavoriteImage Text
- Name one field Hyperlink, name the other field FavoriteImage, and then set the data type to Text.
- Click Save.
- Click the View menu, and then click Datasheet View.
- 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
- Save your table, and then close Access.
back to the topStep 5 - Add a Database Results
RegionTo
add a database results regions, follow these steps: - Switch to FrontPage, and then on the View menu, click Page.
- On the Insert menu, point to Database, and then click Results.
- In the list of existing database connections, click Sample, and then click Next.
- For the record source, click Employees, and then click Next.
- Click Edit List, and then remove all fields except for the following:
LastName FirstName FavoriteImage
- Click OK, and then click Next.
- Click Next again, and then click Finish.
- Name the page Imagetest.asp, and then save the page.
back to the
topStep 6 - Add the Image Links to
the Database ResultsTo
add the image links to the Database Results, follow these steps: - Locate the column value that has the name <<FavoriteImage>> in the Database Results region, and then delete the column value.
- In the table cell where you just removed the column
value, insert the Mycat.jpg image from your Web.
- Right-click the image, and then click Picture Properties.
- Click the General tab, and then click Parameters.
- In the path field, remove the current path, click Insert
Field Parameter, and then click FavoriteImage.
- Click OK, and then click OK again. Note that you will see a small broken image icon in the table
column.
back to the topStep 7 - Hyperlink the
ImagesTo
hyperlink the images, follow these steps: - Right-click the broken image.
- Click Hyperlink, click Parameters, and then remove the whole path that currently exists.
- Click Insert Field Value, select the field that contains the Web
address, click OK, and then click OK again.
- Save the page.
back to the
topREFERENCESFor 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: | Minor | Last Reviewed: | 1/6/2006 |
---|
Keywords: | kbHOWTOmaster KB323033 |
---|
|