Microsoft KB Archive/181208

= FP98: How to Return Records From a Query as a Hyperlink =

Article ID: 181208

Article Last Modified on 6/27/2007

-

APPLIES TO


 * Microsoft FrontPage 98 Standard Edition

-



This article was previously published under Q181208



SUMMARY
This article describes how to return the results from a query as a hyperlink using FrontPage 98 and Active Server Pages (ASP).



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

312638 What You Need to Use Active Server Pages (ASP) in FrontPage

Querying Information from Microsoft Access Database Using ASP
To format results of a query as a hyperlink, follow these steps:  Start Microsoft Access 97 and follow these steps:

 In the Microsoft Access dialog box, click Blank Database and click OK. In the File name box, type Asplink.mdb and click Create. Click the Tables tab. Click New. Click Design View and click OK. In the Field Name box, type Hyperlink. On the View menu, click Datasheet View.</li> Click Yes, name the table Hyperlink, and then click OK.</li> If you are asked to create a primary key, click Yes.</li> In the Hyperlink box, type the following record into the database

<a href="/?scid=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 are want to link to the Microsoft Home Page, you can type the following:

<a href="http://www.microsoft.com">Microsoft</a>

</li> On the File menu, click Exit.</li></ol> </li> Start FrontPage Explorer and create a new Web.

<ol style="list-style-type: lower-alpha;"> On the File menu, point to New, and click FrontPage Web.</li> In Step 1, click One Page Web.</li> In Step 2, click Change.</li> In the "Please specify a location of the New FrontPage Web" box, type the following:

http://localhost/ASPLink

</li> In the "Choose a title for your FrontPage Web" box, type ASPLinks .</li> Click OK twice.</li></ol> </li> On the View menu, click Folders.</li> Import the Microsoft Access 97 database file into the current FrontPage web.

<ol style="list-style-type: lower-alpha;"> On the File menu, click Import.</li> Click Add file.</li> <li>Click Browse, select the file you created in step 1, and click Open.</li> <li>Click OK.</li></ol> </li> <li>Create an executable folder by following these steps:

<ol style="list-style-type: lower-alpha;"> <li>On the File Menu, point to New, and click Folder.</li> <li>Name the folder ASP and press ENTER.</li> <li>Right-click the ASP folder and click Properties on the menu that appears.</li> <li>Click to select the "Allow scripts or programs to be run" check box and click OK.</li></ol> </li> <li>Create a system Data Source Name (DSN).

<ol style="list-style-type: lower-alpha;"> <li>On the Windows Start menu, point to Settings, and then click Control Panel.</li> <li>Double-click the 32-bit ODBC icon (Windows 95) or the ODBC icon (Windows NT).</li> <li>Click the System DSN tab.</li> <li>Click Add.</li> <li>Click "Microsoft Access Driver (*.mdb)" and click Finish.</li> <li>In the Data Source Name box, type Asplink. Note that the DSN name should not include any spaces.</li> <li>Click Select.</li> <li>Select the database file you created in step 1. By default, the file will be located in one of the following IIS Web server locations:

<ul> <li>Microsoft Personal Web Server for Windows 95:

C:\Webshare\Wwwroot\Asplinks\Asplink.mdb

</li> <li>Microsoft Internet Information Server for Windows NT Server:

C:\InetPub\Wwwroot\Asplinks\Asplink.mdb

</li> <li>Microsoft Peer Web Services for Windows NT Workstation:

C:\InetPub\Wwwroot\Asplinks\Asplink.mdb

</li> <li>Microsoft Windows NT 4.0 Option Pack

C:\InetPub\Wwwroot\Asplinks\Asplink.mdb

</li></ul> </li> <li>Click OK three times.</li></ol> </li> <li>In FrontPage Editor, create the ASP page.

<ol style="list-style-type: lower-alpha;"> <li>On the File menu, click New, and then click the Page tab.</li> <li>Double-click Normal Page.</li> <li>On the Insert menu, point to Database, and click Database Region Wizard.</li> <li>In the ODBC Data Source Name (DSN) box, type ASPlink and click Next.</li> <li>In the "Enter the SQL string for the query" box, type the following SQL statement:

SELECT * FROM Hyperlink

</li> <li>Click Next.</li> <li>Click Add Field.</li> <li>In the Add Field dialog box, type Hyperlink and click OK.</li> <li>Click Finish.</li> <li>Click OK.</li> <li>On the File menu, click Save.</li> <li>In the Save As dialog box, select the ASP folder. In the File name box, type hyperlink.asp and click Save.</li></ol> </li> <li>Start your Web browser, type the following URL in the address box and then press ENTER:

http://localhost/asplink/asp/hyperlink.asp

</li></ol>

For more information about Active Server Pages and FrontPage, please see the following articles in the Microsoft Knowledge Base:

174015 FP98: How to Create Active Server Pages in FrontPage 98

175770 FP98: How to Post Information to a Database Using ASP

175771 FP98: How to Display Contents of a Database Using ASP

Additional query words: 98 asp iis fpodbc

Keywords: kbhowto KB181208

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.