FP98: How to Return Plain Text as a URL from a Database

ID: Q187823


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


SUMMARY

This article explains how to return plain text as a hyperlink by modifying the Database Region Wizard code that is generated by Microsoft FrontPage. For example, if you have a database that contains e-mail addresses that are stored in the format of 'example@microsoft.com,' you can return that data as a live hyperlink by using the FrontPage Database Region Wizard.


MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
  1. In FrontPage Explorer, right-click the .asp file that contains the query that returns the results of a search and click Open With.


  2. In the Open With Editor dialog box, click Text Editor (Notepad.exe).


  3. In the code for the .asp page, find the line that writes the text for the field that you want to return as a Uniform Resource Locator (URL).


  4. Example 1

    If you want to return a field titled "email" the code would be similar to the following:
    
    If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then
    Response.Write CStr(fp_rs("email")) 

    Example 2

    If you want to return a field titled "links" the code would be similar to the following:
    
    If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then
    Response.Write CStr(fp_rs("links")) 
  5. Modify the code so that the Response.Write procedure adds the HTML code for a hyperlink:


  6. Example 1:

    To return the "email" field as a mailto hyperlink, change the code to the following:
    
    If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write
    "<a href='mailto:" & CStr(fp_rs("email")) & "'>" &
    CStr(fp_rs("email")) & "</a>" 

    Example 2:

    To return the "links" field as an HTTP hyperlink, change the code to the following:
    
    If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write
    "<a href='http://" & CStr(fp_rs("links")) & "'>" &
    CStr(fp_rs("links")) & "</a>" 
Note: The method described in this article is not neccessary for FrontPage 2000.

Additional query words: 98

Keywords :
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


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