Display a picture by using an Access database in
FrontPage 2003
Display a picture by using an Access database in
FrontPage 2003
A D V E R T I S E M E N T
Create a new personal Web site
To
create a new personal Web site, follow these steps:
1.
Start FrontPage.
2.
On the File
menu, click New.
3.
In the New task
pane, click More Web site templates.
4.
In the Web Site
Templates dialog box, click
Personal Web Site.
5.
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:
6.
Click OK to
create the Web site.
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.
Modify the Employees table in the
database
To
modify the Employees table in the database, follow these steps:
1.
On the View
menu, click Folders.
2.
Double-click the fpdb
folder, and then double-click the
fpnwind.mdb file to open the file in Access.
3.
Double-click the
Employees table to open it.
4.
On the View
menu, click Design View.
5.
At the end of the table, click in the first
blank row to add a new field to the table.
6.
Configure the new field as follows:
a.
In the Field Name column, type
FavoriteImage.
b.
In the Data Type column, click
Text.
7.
On the File
menu, click Save.
8.
On the View
menu, click Datasheet View.
9.
Type the following values in the FavoriteImage
row for each of the employees:
Employee
FavoriteImage
Nancy Davolio
images/mycat.jpg
Andrew Fuller
images/mount.gif
All other employees
images/parrot1.jpg
10.
To close the database and to return to
FrontPage, click Exit on the
File menu.
11.
On the View
menu, click Refresh.
Add a Database Results region
To add
a Database Results region, follow these steps:
1.
On the View
menu, click Page.
2.
On the Insert
menu, point to Database, and
then click Results.
3.
Follow these steps in the Database Results
Wizard:
a.
In the list of existing database
connections, click Sample,
and then click Next.
b.
In the Record
source list, click
Employees, and then click
Next.
c.
Click Edit List.
d.
Remove all fields except for the
following fields:
�
LastName
�
FirstName
�
FavoriteImage
e.
Click OK.
f.
Click Next
two times, and then click Finish.
4.
On the File
menu, click Save.
5.
Type imagetest.asp
in the File name box, and then
click OK.
Add the image links to the database
results
To add
the image links to the database results, follow these steps:
1.
Click the <<FavoriteImage>> value in the
FavoriteImage column, and then press DELETE.
2.
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:
a.
On the Insert
menu, point to Picture,
and then click From file.
b.
Locate the Mycat.jpg image in the Image
folder of your Web site.
c.
Click the image, and then click
OK.
3.
Right-click the image, and then click
Picture Properties.
4.
Click the General
tab.
5.
Click Parameters.
6.
In the Path
box, remove the current path.
7.
Click Insert Field Value,
and then click FavoriteImage.
8.
Remove the quotation marks from the start and
end of the field value.
9.
Click OK two
times. You see a small, broken image icon in the table column.
10.
Save the page, and then click
Preview in Browser on
the toolbar.