Working w/Database Results

  • Thread starter Thread starter AmyD
  • Start date Start date
A

AmyD

I am using the database results wizard to generate a list
of companies on my page. I have that working. But I want
to make each company listed a hyperlink to another asp
file that when passed the company (or database id), will
lookup and print their logo. I don't want to manually have
to add the hyperlinks because the companies will change
frequently. Can I do this within FrontPage?
Thanks,
Amy
 
Place the logo into a folder within your web, then add a field to your
database for the filename. Then in your page create link similar to the
following depending on how your web is structured:

<img border="0" src="../Photos/Listings/<%=PageRS("Photo")%>" width="300">

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
-----Original Message-----
I am using the database results wizard to generate a list
of companies on my page. I have that working. But I want
to make each company listed a hyperlink to another asp
file that when passed the company (or database id), will
lookup and print their logo. I don't want to manually
have to add the hyperlinks because the companies will
change frequently. Can I do this within FrontPage?

Yes, but it takes more than a few mouse clicks.

Basically, in your first DRW page, you need to create a
custom query that returns hyperlink HTML pointing to your
second page. For example, if your company ID field is
cmpid, your custom query might begin:

SELECT '<a href=logopage.asp?cmpid=' & [cmpid] & '>' &
[cmpid] & '</a>' AS cmplink, ... (rest of SQL statement)

where logopage.asp is the name of the second DRW page.
Then, in the first, page, you include the cmplink field as
a column that the DRW will display.

Once you finish running hte DRW, right-click the column
that displays the cmplink value, choose Database Column
Value Properties, and select Column Value Contains HTML.

When you save and run this first DRW page, you should now
get a column of hyperlinks showing the Company ID, with
target locations like logopage.asp?cmpid=123 (where 123 is
a company ID).

When you create the second DRW page, at step 3, click More
Options, Criteria, Add and specify cmpid as the name of a
criteria value, and select Use This Search Form Field. But
at step 5, be sure the Add Search Form value is cleared.

I presume the logos are GIF or JPEG files stored at some
location within your Web. To display these, make the file
name a field in your database, and create a custom query
that returns a column of <img> tags. For example:

SELECT
 
-----Original Message-----
I am using the database results wizard to generate a list
of companies on my page. I have that working. But I want
to make each company listed a hyperlink to another asp
file that when passed the company (or database id), will
lookup and print their logo. I don't want to manually
have to add the hyperlinks because the companies will
change frequently. Can I do this within FrontPage?

Yes, but it takes more than a few mouse clicks.

Basically, in your first DRW page, you need to create a
custom query that returns hyperlink HTML pointing to your
second page. For example, if your company ID field is
cmpid, your custom query might begin:

SELECT '<a href=logopage.asp?cmpid=' & [cmpid] & '>' &
[cmpid] & '</a>' AS cmplink, ... (rest of SQL statement)

where logopage.asp is the name of the second DRW page.
Then, in the first, page, you include the cmplink field as
a column that the DRW will display.

Once you finish running hte DRW, right-click the column
that displays the cmplink value, choose Database Column
Value Properties, and select Column Value Contains HTML.

When you save and run this first DRW page, you should now
get a column of hyperlinks showing the Company ID, with
target locations like logopage.asp?cmpid=123 (where 123 is
a company ID).

When you create the second DRW page, at step 3, click More
Options, Criteria, Add and specify cmpid as the name of a
criteria value, and select Use This Search Form Field. But
at step 5, be sure the Add Search Form value is cleared.

I presume the logos are GIF or JPEG files stored at some
location within your Web. To display these, make the file
name a field in your database, and create a custom query
that returns a column of <img> tags. For example:

SELECT cmpid, cmpname, '<img src=' & cmplogo & '>' as
logolink, ...(rest of SQL statement)

where cmplogo is the name of the field that contains the
name of the logo file.

As on the first page, after running the DRW, right-click
the column that displays the logolink value, choose
Database Column Value Properties, and select Column Value
Contains HTML.

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Back
Top