Microsoft KB Archive/318813

= HOW TO: Display a Picture By Using a Microsoft Access Database in FrontPage 2002 =

Article ID: 318813

Article Last Modified on 2/1/2007

-

APPLIES TO


 * Microsoft FrontPage 2002 Standard Edition

-



This article was previously published under Q318813



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

IN THIS TASK
SUMMARY
 * 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

REFERENCES (back to top)



SUMMARY
Use this step-by-step guide 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 top)

Step 1 - Prerequisites
Get Ready to Use the ASP Features in FrontPage

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

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

Install Both Microsoft FrontPage and Microsoft Access

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

(back to top)

Step 2 - Create a New Personal Web
 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. Type the URL of a new personal Web on a Web server that supports Active Server Pages, for example:

http://mywebserver/mypersonalweb/

 Click OK to create the web.

(back to top)

Step 3 - Add the Sample Database to the Web

 * 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 top)

Step 4 - Modify the Employees Table in the Database
 On the View menu, click Folders. Double-click the fpdb folder, and then double-click the fpnwind.mdb file to open the file in Microsoft Access.</li> Double-click the Employees table to open it.</li> Click Design.</li> Add a new field after the last field. Name this field FavoriteImage and set the data type to Text. Click Save. Click View.</li>  Set the FavoriteImage field by using the information in the following table: <pre class="fixed_text"> For Employee             Type this in the FavoriteImage field Nancy Davolio            images/mycat.jpg Andrew Fuller            images/mount.gif All remaining employees  images/parrot1.jpg </li> On the File menu, click Exit to close the database and return to FrontPage.</li> On the View menu, click Refresh.</li></ol>

(back to top)

Step 5 - Add a Database Results Region
 On the View menu, click Page.</li> On the Insert menu, point to Database, and then click Results.</li> In the list of existing database connections, click Sample. Click Next.</li> For the record source, click Employees, and then click Next.</li> Click Edit List.</li> Remove all fields except for the following:

LastName

FirstName

FavoriteImage

Click OK. Click Next.</li> Click Next again.</li> Click Finish.</li> <li>Save the page and name it imagetest.asp .</li></ol>

(back to top)

Step 6 - Add the Image Links to the Database Results

 * 1) Locate the database column value named <<FavoriteImage>>, and then delete it.
 * 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 on the shortcut menu.
 * 4) Click the General tab.
 * 5) Click Parameters.
 * 6) In the path field, remove the current path. Click Insert Field Parameter, and then click FavoriteImage.
 * 7) Click OK twice.

You will see a small broken image icon in the table column.
 * 1) Save the page, and then click the Preview in Browser button on the Standard toolbar.

(back to top)

<div class="references_section">