Query Database, Display as hyperlink

B

BOBss

I am using ASP with VBScript. I want to query an access database username
field, and display the output as a hyperlink on an a webpage.The webpage
will display all records. I then need to be able to select a given
record(hyperlink), and display all of the fields for that record on another
webpage so I can execute some code against it.

Can anyone point me to some sample code so I can get an idea of how to
accomplis this?

Thanks in advance
 
A

Adrienne Boswell

I am using ASP with VBScript. I want to query an access database
username field, and display the output as a hyperlink on an a
webpage.The webpage will display all records. I then need to be able
to select a given record(hyperlink), and display all of the fields for
that record on another webpage so I can execute some code against it.

Can anyone point me to some sample code so I can get an idea of how to
accomplis this?

Thanks in advance
<%

dim sql, rs, rsarr, norecords, i

'I don't know your fieldnames, just assuming here

sql = "SELECT id, username FROM table "
set rs = createobject("ADODB.Recordset")
rs.Open sql, yourconnection
if not rs.EOF then
rsarr = rs.getrows()
norecords = false
else
norecords = true
end if
rs.Close
set rs = nothing

if not norecords then
%>
<ul>
<%
for i = 0 to ubound(rsarr,2)
%>
<li><a href="processpage.asp?id=<%=rsarr(0,i)%>"><%=rsarr(1,i)%></li>
%>
next
%>
</ul>
<%
else
%>
<p>No records available.</p>
<% end if%>



---- processpage.asp ----
<% id = request.querystring("id")
sql = "SELECT fields FROM table WHERE id = " & id
'do whatever else you need to do from here
 
E

Evertjan.

Adrienne Boswell wrote on 21 jun 2007 in
microsoft.public.inetserver.asp.general:
<li><a href="processpage.asp?id=<%=rsarr(0,i)%>"><%=rsarr(1,i)%></li>

</a> ?
 
A

Adrienne Boswell

Adrienne Boswell wrote on 21 jun 2007 in
microsoft.public.inetserver.asp.general:


</a> ?

Validation Failed - XXX Errors

It was late, sorry about that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top