Database + Hyperlinks

G

Guest

I query a database that returns an address for a pdf I want to link to. My
field in the database has the address, and my database results page takes
that generated info and makes it a hyperlink. This works fine as long as
there is something in the field in the database. If the field is empty,
there is no address there but it has a one charachter wide section of
underline like there is still a link. When you click this it gives a
database results error page like it is trying to reprocess the form or
something.

The field containing the address in my database is empty, I double checked
that. If I remove the "make hyperlink" property from the field in my
database results page, it is fine nothing is returned. My thinking is that
once it is made a hyperlink in the database results page it has to return
something since a hyperlink cannot be empty.

I wonder if there is a way around this? Thanks
 
T

Thomas A. Rowe

I solve this issue by having a Yes/No file in the database related to the hyperlink field, then in
my page I do the following:

<% If objRS("LinkYN") = Yes Then %>
<a href="<%=objRS("LinkURL")%>"><%=objRS("LinkTitle")%></a>
<% Else %>
&nbsp;
<% End If %>

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top