Solved

Hyperlink recordset field from access database in web page.

Posted on 2004-04-16
3
269 Views
Last Modified: 2012-05-04
I have a link table in an access database and using a query I want to call the links of an employee into a web page.  The link_name field is text and the link_url field in a hyperlink in the database.

 I need to be able to call the recordset and click on the links which would direct me to another web page.  Currently clicking the link puts the url in the current browser url:

http://localhost/mylinks.asp#http://www.ultra-fitmagazine.com#

Code:
<table border="1" width="100%">
<tr>
<th>My Links</th>
</tr>
                              
<%

sql = "SELECT tblLink.link_name, tblLink.link_url FROM tblEmployee INNER JOIN tblLink ON tblEmployee.User_id = tblLink.user_id"

rs.open sql,myconn,3,3
rs.movefirst
do until rs.eof
%>

<tr><td>
<a href="<%=rs("link_url")%>"><%=rs("link_name")%></a></td></tr>

<%
rs.movenext
Loop      
rs.close
%>      
</table>

Please can somebody help me solve this problem?

Thanks
0
Comment
Question by:ladykh
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 500 total points
ID: 10847527
try this code

<table border="1" width="100%">
<tr>
<th>My Links</th>
</tr>
                         
<%

sql = "SELECT tblLink.link_name, tblLink.link_url FROM tblEmployee INNER JOIN tblLink ON tblEmployee.User_id = tblLink.user_id"

rs.open sql,myconn,3,3
rs.movefirst
do until rs.eof
%>

<tr><td>
<%
    Dim list,lnk_url
    list = Split(rs("link_url"), "#")
    lnk_url = list(1)
%>
<a href="<%=lnk_url%>"><%=rs("link_name")%></a></td></tr>

<%
rs.movenext
Loop    
rs.close
%>    
</table>
0
 

Author Comment

by:ladykh
ID: 10848638
To venkateshwarr
Thank you very much, it worked perfectly!
Thanks
0
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10848807
you are welcome..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now