Solved

Hyperlink recordset field from access database in web page.

Posted on 2004-04-16
3
266 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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 …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

8 Experts available now in Live!

Get 1:1 Help Now