Click to See Complete Forum and Search --> : Anchors with Access database


LadyBug
04-26-2003, 04:51 PM
I have an asp page that pulls records from an Access database of alphabetized (by last name) member names. What I want to do is display a line of alphabetic links so that when a letter is clicked, it jumps to the first member whose last name starts with that letter. For example, members are Bill Hairy, Tom Handsome, Peter Homely, etc. If a user clicks on the hyperlinked H, the page will jump to Bill Hairy.

My problem is naming the anchors within the list of members. Can I do that IN the database or is there another way around it to get the same result? I've seen it done, so I know it can be, but I'm still learning about ASP and SQL.

If anyone has any ideas, I'd appreciate it. If you want to see the page I'm talking about, it's www.mulvanemarauders.com/Members.asp (http://www.mulvanemarauders.com/Members.asp)

LadyBug
04-26-2003, 07:09 PM
I thought that would work, but the problem is that some of the first and last names are linked with the member's email address (for those that have email addresses). When I try to put an anchor around their last name, only the first name shows up as a link, and with or without an email address the last name loses the font attribute set in the stylesheet.

<% IF lastname <> "" THEN %>
<% IF email <> "" THEN %>

<a href="mailto:<% =email %>"><% =firstname %>&nbsp;<% =lastname %></a>&nbsp;-&nbsp;<% =city %>&nbsp;<% =state %><br>
<% ELSE %>
<font color="#020280"><b><% =firstname %>&nbsp;<% =lastname %></font></b>&nbsp;-&nbsp;<% =city %>&nbsp;<% =state %><tr>
</tr>
<% END IF %>

Do I somehow need to set up an IF THEN statement for each anchor? I'm at a total loss.