Microsoft KB Archive/825515

= How to display a picture by using an Access database in FrontPage 2003 =

Article ID: 825515

Article Last Modified on 1/6/2006

-

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.



IN THIS TASK

 * Summary
 * Prerequisites
 * Create a new personal Web site
 * Add the sample database to the Web site
 * Modify the Employees table in the database
 * Add a Database Results region
 * Add the image links to the database results
 * References



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

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:  Start FrontPage. On the File menu, click New. In the New task pane, click More Web site templates. In the Web Site Templates dialog box, click Personal Web Site. 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/

 Click OK to create the Web site.</li></ol>

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: <ol> On the View menu, click Folders.</li> Double-click the fpdb folder, and then double-click the fpnwind.mdb file to open the file in Access.</li> Double-click the Employees table to open it.</li> On the View menu, click Design View.</li> At the end of the table, click in the first blank row to add a new field to the table.</li> Configure the new field as follows: <ol style="list-style-type: lower-alpha;"> In the Field Name column, type FavoriteImage .</li> In the Data Type column, click Text.</li></ol> </li> On the File menu, click Save.</li> On the View menu, click Datasheet View.</li> Type the following values in the FavoriteImage row for each of the employees: </li> To close the database and to return to FrontPage, click Exit on the File menu.</li> On the View menu, click Refresh.</li></ol>

back to the top

Add a Database Results region
To add a Database Results region, follow these steps: <ol> On the View menu, click Page.</li> On the Insert menu, point to Database, and then click Results.</li> <li>Follow these steps in the Database Results Wizard: <ol style="list-style-type: lower-alpha;"> <li>In the list of existing database connections, click Sample, and then click Next.</li> <li>In the Record source list, click Employees, and then click Next.</li> <li>Click Edit List.</li> <li>Remove all fields except for the following fields: <ul> <li>LastName</li> <li>FirstName</li> <li>FavoriteImage</li></ul> </li> <li>Click OK.</li> <li>Click Next two times, and then click Finish.</li></ol> </li> <li>On the File menu, click Save.</li> <li>Type imagetest.asp in the File name box, and then click OK.</li></ol>

back to the top

Add the image links to the database results
To add the image links to the database results, follow these steps: <ol> <li>Click the <<FavoriteImage>> value in the FavoriteImage column, and then press DELETE.</li> <li>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: <ol style="list-style-type: lower-alpha;"> <li>On the Insert menu, point to Picture, and then click From file.</li> <li>Locate the Mycat.jpg image in the Image folder of your Web site.</li> <li>Click the image, and then click OK.</li></ol> </li> <li>Right-click the image, and then click Picture Properties.</li> <li>Click the General tab.</li> <li>Click Parameters.</li> <li>In the Path box, remove the current path.</li> <li>Click Insert Field Value, and then click FavoriteImage.</li> <li>Remove the quotation marks from the start and end of the field value.</li> <li>Click OK two times. You see a small, broken image icon in the table column.</li> <li>Save the page, and then click Preview in  on the toolbar.</li></ol>

back to the top

<div class="references_section">