This article describes how to return the results from a
query as a hyperlink using FrontPage and Active Server Pages (ASP).
Query Information from Microsoft Access Database Using ASP
Use the following procedures to query information from an MS
Access database with an ASP web page. After a web project is created you can
import an MS Access database to the web so you can make it accessible to use
with the ASP web page.
Format Results of a Query as a Hyperlink
- Start Microsoft Access 2000
- In the Microsoft Access dialog box, click Blank Database and click OK.
- In the File name box, type: "Asplink.mdb" (without the quotes) and click Create.
- Click the Tables tab. Double-click Create Table in Design View.
- In the Field Name box, type Hyperlink.
- On the View menu, click Datasheet View.
- When you are prompted to save, click Yes, name the table: "Hyperlink" (without the quotes), and then click
OK.
- If you are asked to create a primary key, click Yes.
- In the Hyperlink box, type the following record into the database:
<a href="hyperlink">TextToDisplay</a>
where hyperlink is the URL this record will link to and TextToDisplay is the
display text for the record. For example, if you want to link to the Microsoft
Home Page, you can type the following:
<a href="http://www.microsoft.com">Microsoft</a>
- On the File menu, click Exit.
Create a Web
- Start FrontPage and create a new Web.
- On the File menu, point to New, and click Web.
- Click One Page Web.
- In the Please specify a location of the new web box, type the following:
- Click OK
Import Database into Current Web
- On the File menu, click Import.
- Click Add File.
- Select the asplink.mdb file from the file list, and click Open
- Click OK.
- When you are prompted to create a new database connection,
type: "ASPLink" for the name (without the quotes), and click Yes.
- Click Yes again. You have now added the database to your web. This allows
your web to have access to the database once you have created your ASP
page.
Create the ASP Page
In FrontPage, create the ASP page.
- On the View menu, click Page.
- On the File menu, point to New, and then click the page.
- Double-click Normal Page.
- On the Insert menu, point to Database, and click Results.
- In Step One of the Database Results Wizard, click to select Use an existing database connection, and select ASPLink from the list.
- Click Next.
- Select the Hyperlink table from the Record Source list, and click Next.
- Click Next twice, then click Finish.
- Right Click the <<Hyperlink>> column, and select Database Column Value Properties.
- Click to select the Column value contains HTML check box, and click OK.
- Save the Page.
- On the File menu, click Preview in Browser.
- Click Microsoft Internet Explorer 5.0, and then click Preview.