Solved

ASP + creating hyperlink to data

Posted on 2003-11-04
1
218 Views
Last Modified: 2008-02-26
Im my table below I'd like to have the "id" field- objRS.Fields("id") be a link to the information that is stored in my database.

How do I get this hyperlink to show the what is stored in database for the particular row where "id" is the unique key for the row?

This is what I have right now.

<a href="content.asp?article=<%=objRS.Fields("id")%>"><%=objRS.Fields("subject")%></a></td>

Don't worry about the datasebase connection line since I have that set up as an include and is working.

Full Code
___________________________________________________________________


<%Language=VBScript%>

<%
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "Select id, News_date, subject, News_to, DATEADD(day, 15, News_date) AS recentdate FROM news WHERE DateDiff(day,News_date,GetDate())<=15 and News_date <= getdate() ORDER BY News_date desc",cn  
 
%>
 
 
<table width="100%" border="0" cellspacing="4" cellpadding="2">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="1" class="bg01">
<tr>
<td colspan="4" valign="top" class="bg05"><strong><font size="2">October 2003</font>
</td>
</tr>
<tr>
<td width="7%" valign="top" class="bg02"><strong>Date</strong></td>
<td width="43%" valign="top" class="bg02"><strong>Subject</strong></td>
<td width="47%" valign="top" class="bg02"><strong>Audience</strong></td>
</tr>
<%Do until objRS.EOF
%>
<tr class="bg03">
<td valign="top"><%=objRS.Fields("News_date")%></td>
<td valign="top"><a href="content.asp?article=<%=objRS.Fields("id")%>"><%=objRS.Fields("subject")%></a></td>
<td valign="top"><%=objRS.Fields("News_to")%></td>
</tr>


<% objRS.MoveNext
%>
<%
Loop
objRS.Close
%>
</table></td>
</tr>
</table>
0
Comment
Question by:Lukeskywalker
1 Comment
 
LVL 58

Accepted Solution

by:
Gary earned 75 total points
ID: 9679532
In content.asp

<%
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "Select * FROM news WHERE id="& request("article"),cn  
%>
Then just iterate through the fields
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

Title # Comments Views Activity
SQL Server Web Traffic Limitations 4 53
ASP Classic - Load test 2 44
JSON error 4 50
How can I do a Massively massive community reviewing-and-grading site? 7 69
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

22 Experts available now in Live!

Get 1:1 Help Now