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

ID: Q181208


The information in this article applies to:
  • Microsoft FrontPage 98 for Windows


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

Getting Ready to Use the ASP Features in FrontPage 98

Before you can use the ASP features in FrontPage 98, you must install the following components:
  • A 32-bit ODBC driver.


  • One of the following servers:

    • Microsoft Internet Information Server (IIS) 2.0 or 3.0 for Microsoft Windows NT Server.


    • Microsoft Windows NT Option Pack.


    • Microsoft Peer Web Services for Microsoft Windows NT Workstation.


    • Microsoft Personal Web Server for Microsoft Windows 95.




  • An ASP engine on the IIS derivative Web server.


  • FrontPage 98 Server Extensions.


NOTE: If you are using Windows NT 4.0 Option Pack you do not need to install the ASP engine separately.

Querying Information from Microsoft Access Database Using ASP

To format results of a query as a hyperlink, follow these steps:
  1. Start Microsoft Access 97 and follow these steps:

    1. In the Microsoft Access dialog box, click Blank Database and click OK.


    2. In the File name box, type Asplink.mdb and click Create.


    3. Click the Tables tab. Click New.


    4. Click Design View and click OK.


    5. In the Field Name box, type Hyperlink.


    6. On the View menu, click Datasheet View.


    7. Click Yes, name the table Hyperlink, and then click OK.


    8. If you are asked to create a primary key, click Yes.


    9. 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 are want to link to the Microsoft Home Page, you can type the following:
      <a href="http://www.microsoft.com">Microsoft</a>


    10. On the File menu, click Exit.




  2. Start FrontPage Explorer and create a new Web.

    1. On the File menu, point to New, and click FrontPage Web.


    2. In Step 1, click One Page Web.


    3. In Step 2, click Change.


    4. In the "Please specify a location of the New FrontPage Web" box, type the following:
      http://localhost/ASPLink


    5. In the "Choose a title for your FrontPage Web" box, type ASPLinks .


    6. Click OK twice.




  3. On the View menu, click Folders.


  4. Import the Microsoft Access 97 database file into the current FrontPage web.

    1. On the File menu, click Import.


    2. Click Add file.


    3. Click Browse, select the file you created in step 1, and click Open.


    4. Click OK.




  5. Create an executable folder by following these steps:

    1. On the File Menu, point to New, and click Folder.


    2. Name the folder ASP and press ENTER.


    3. Right-click the ASP folder and click Properties on the menu that appears.


    4. Click to select the "Allow scripts or programs to be run" check box and click OK.




  6. Create a system Data Source Name (DSN).

    1. On the Windows Start menu, point to Settings, and then click Control Panel.


    2. Double-click the 32-bit ODBC icon (Windows 95) or the ODBC icon (Windows NT).


    3. Click the System DSN tab.


    4. Click Add.


    5. Click "Microsoft Access Driver (*.mdb)" and click Finish.


    6. In the Data Source Name box, type Asplink. Note that the DSN name should not include any spaces.


    7. Click Select.


    8. 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:

      • Microsoft Personal Web Server for Windows 95:
        C:\Webshare\Wwwroot\Asplinks\Asplink.mdb


      • Microsoft Internet Information Server for Windows NT Server:
        C:\InetPub\Wwwroot\Asplinks\Asplink.mdb


      • Microsoft Peer Web Services for Windows NT Workstation:
        C:\InetPub\Wwwroot\Asplinks\Asplink.mdb


      • Microsoft Windows NT 4.0 Option Pack
        C:\InetPub\Wwwroot\Asplinks\Asplink.mdb




    9. Click OK three times.




  7. In FrontPage Editor, create the ASP page.

    1. On the File menu, click New, and then click the Page tab.


    2. Double-click Normal Page.


    3. On the Insert menu, point to Database, and click Database Region Wizard.


    4. In the ODBC Data Source Name (DSN) box, type ASPlink and click Next.


    5. In the "Enter the SQL string for the query" box, type the following SQL statement:
      SELECT * FROM Hyperlink


    6. Click Next.


    7. Click Add Field.


    8. In the Add Field dialog box, type Hyperlink and click OK.


    9. Click Finish.


    10. Click OK.


    11. On the File menu, click Save.


    12. In the Save As dialog box, select the ASP folder. In the File name box, type hyperlink.asp and click Save.




  8. Start your Web browser, type the following URL in the address box and then press ENTER:
    http://localhost/asplink/asp/hyperlink.asp



For more information about Active Server Pages and FrontPage, please see the following articles in the Microsoft Knowledge Base:
Q174015 FP98: How to Create Active Server Pages in FrontPage 98

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

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

Additional query words: 98 asp iis fpodbc

Keywords : kbdta fphtml fpodbc fpiis
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: July 27, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.