Gazing into my crystal ball I observed "BOBss" <Bo***@123.comw riting
in news:uM******** ******@TK2MSFTN GP06.phx.gbl:
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(hyperlin k), 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("A DODB.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="processpa ge.asp?id=<%=rs arr(0,i)%>"><%= rsarr(1,i)%></li>
%>
next
%>
</ul>
<%
else
%>
<p>No records available.</p>
<% end if%>
---- processpage.asp ----
<% id = request.queryst ring("id")
sql = "SELECT fields FROM table WHERE id = " & id
'do whatever else you need to do from here
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share