Solved

ASP + creating hyperlink to data

Posted on 2003-11-04
1
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Scheduled IIS .Net2 AppPools recycle and SQL connection Hangs 33 148
ASP and Extracting XML 7 25
ASP Classic, check if Querystring is UCase or LCase 8 28
window close link 7 32
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 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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 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