ACC97: Can't Create Valid Links in Hyperlink Field on ASP Form
ID: Q165295
|
The information in this article applies to:
SYMPTOMS
Novice: Requires knowledge of the user interface on single-user computers.
When you use Microsoft Access 97 to create an Active Server Pages (ASP)
form, and you use that form to add or modify data in a Hyperlink field, the
record in the table does not contain a valid hyperlink.
CAUSE
ASP forms do not contain the built-in functionality to add Hyperlink
fields.
RESOLUTION
You can edit the Hyperlink field in the Microsoft Access table to provide
the missing information, or you can enter the Hyperlink field on the ASP
form in a way that Microsoft Access understands and translates to hyperlink
data.
NOTE: Both of the following methods create a valid hyperlink in the
Microsoft Access table, but not on the ASP form itself. You cannot follow
hyperlinks displayed in a text box on an ASP form.
Editing the Record in the Table
- After you add a new record using the ASP form, start Microsoft Access
and open the database in which the table resides.
- Locate the newly added record.
- Using the right mouse button (right-click), click the Hyperlink field in
the record.
- On the shortcut menu that appears, point to Hyperlink, and then click
Edit Hyperlink.
- In the Insert Hyperlink dialog box, fill in the missing information in
the "Link to file or URL" box and the "Named location in file" box.
Click OK.
Entering the Record as a Hyperlink on the ASP Form
When you add or modify a record using the ASP form, you can type the
hyperlink information in a way that enables Microsoft Access to create a
valid Hyperlink field in the table.
All Hyperlink fields consist of three separate parts, separated by number
signs: DisplayText, Address, and Subaddress. The DisplayText is what you
see in the table or on the form; the address and subaddress information
tells Microsoft Access what you want to view when you click the hyperlink.
For example, the following hyperlink uses all three parts of the hyperlink
field:
1997 Sales Figures#C:\My Documents\Sales.ppt#24
In this example, 1997 Sales Figures is what a user sees in the hyperlink
field, C:\My Documents\Sales.ppt is the name of the Microsoft PowerPoint
slide that opens when you click the link, and 24 is the slide number that
is displayed.
The next examples use only two of the three parts in the Hyperlink field:
Microsoft Home Page#http://www.microsoft.com#
Quarterly Orders Form##Form Quarterly Orders
The first hyperlink displays the text "Microsoft Home Page" and opens
http://www.microsoft.com when you click the link. The second hyperlink
displays the text "Quarterly Orders Form" and opens the Quarterly Orders
form in the current database when you click it.
Finally, this example uses only one of the parts of the Hyperlink field:
#http://www.microsoft.com/accessdev#
In this case, Microsoft Access displays http://www.microsoft.com/accessdev
by default because there is no specific display text, and it also opens
http://www.microsoft.com/accessdev when you click it.
If you enter hyperlink data in your ASP form using the correct syntax for
DisplayText, Address, and Subaddress, then Microsoft Access stores the data
as a valid hyperlink.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
CAUTION: Following the steps in this example will modify the sample
database Northwind.mdb. You may want to back up the Northwind.mdb file
and perform these steps on a copy of the database.
- Start Microsoft Access and open the sample database Northwind.mdb.
- Select the Suppliers table in the Database window.
- On the File menu, click Save As/Export.
- In the Save As dialog box, click "To an External File or Database," and
then click OK.
- In the "Save Form 'Suppliers' In" dialog box, select Microsoft Active
Server Pages (*.asp) in the Save As Type box, and save the
Suppliers.asp file in a folder on your Web server where you have
Execute permission. Click Export.
- In the Microsoft Active Server Pages Output Options dialog box, type a
valid System DSN on your Web server in the Data Source Name box, and
type the uniform resource locator (URL) on your server where the ASP
file will be located in the Server URL box. Click OK.
- Start Microsoft Internet Explorer 3.0, or another Web browser program.
- Type the URL in the address box of your Web browser to view
Suppliers.asp, for example http://MyServer/Aspsamp/Suppliers.asp. Note
that the URL depends upon where your files are located on the Web
server computer.
- The Suppliers form opens in your Web browser and displays the first
record in the Suppliers table.
- Click in the Home Page field of the first record and enter the
following data:
http://www.microsoft.com
- Click the Commit button at the bottom of the form to save the record.
- In Microsoft Access, open the Suppliers table in Datasheet view.
- Locate the Supplier record you just changed (probably Exotic Liquids)
and click in the Home Page Hyperlink field. Note that nothing happens.
If you repeat steps 7-13, but you enter the following data in step 10,
the hyperlink will work properly in Microsoft Access:
Microsoft Home Page#http://www.microsoft.com#
REFERENCES
For more information about the parts of a Hyperlink field, search the Help
Index for "hyperlinks, returning hyperlink information."
For more information about exporting ASP files, search the help Index for
"ASP files," or ask the Microsoft Access 97 Office Assistant.
For more information about creating and using System DSNs, please see the
following article in the Microsoft Knowledge Base:
Q159682 "Data Source Name Not Found" Err Msg Opening Web Page
For more information about the permission you need on your Web server
computer to view ASP files, please see the following article in the
Microsoft Knowledge Base:
Q162975 ACC97: Permissions Necessary to View HTML, IDC, and ASP
Files
Additional query words:
follow open data entry
Keywords : kbinterop IntLink IntAsp
Version : 97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 22, 1999