Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic Help Please - Call further detail from initial query

Status
Not open for further replies.

Webflex

Technical User
Apr 20, 2001
101
GB
I have a page that pulls a listing from an employee directory and want to add the option to display further detail including photo's

The id is passed to the edit/delete page via a url formed as below.

Code:
[URL unfurl="true"]http://XXXXXXXX/phone/iphone/picture.asp?action=display&id=858[/URL]

This calls up the following in the picture.asp page


Code:
<%
option explicit
dim useraction
dim dsn,sql,conn,rs
dim fname,lname,tel,mobile,init,dept,id
id=request(&quot;id&quot;)
useraction=request(&quot;action&quot;)
dsn=&quot;DBQ=&quot; & Server.Mappath(&quot;../db/mydb.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;
set conn=server.createObject(&quot;adodb.connection&quot;)
conn.open dsn
select case useraction
case &quot;display&quot;
sql = &quot;select * from users where id=&quot;&id
set rs = conn.execute(sql)
lname=rs(&quot;lname&quot;)
fname=rs(&quot;fname&quot;)
tel=rs(&quot;tel&quot;)
mobile=rs(&quot;mobile&quot;)
init=rs(&quot;init&quot;)
dept=rs(&quot;dept&quot;)
conn.close
set conn = nothing
%>

<%end select%>


How do I write this information out?

TIA
Webflex
 
You can display the data in a table using the following code:

<%
option explicit
dim useraction
dim dsn,sql,conn,rs
dim fname,lname,tel,mobile,init,dept,id
id=request(&quot;id&quot;)
useraction=request(&quot;action&quot;)
dsn=&quot;DBQ=&quot; & Server.Mappath(&quot;../db/mydb.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;
set conn=server.createObject(&quot;adodb.connection&quot;)
conn.open dsn
select case useraction
case &quot;display&quot;
sql = &quot;select * from users where id=&quot;&id
set rs = conn.execute(sql)
response.write(&quot;<table border=1>&quot;)
while not rs.eof
response.write(&quot;<tr><td>lname=</td><td>&quot; & rs(&quot;lname&quot;) & &quot;</td></tr>&quot;
response.write(&quot;<tr><td>fname=</td><td>&quot; & rs(&quot;fname&quot;)& &quot;</td></tr>&quot;
response.write(&quot;<tr><td>tel=</td><td>&quot; & rs(&quot;tel&quot;)& &quot;</td></tr>&quot;
response.write(&quot;<tr><td>mobile=</td><td>&quot; & rs(&quot;mobile&quot;)& &quot;</td></tr>&quot;
response.write(&quot;<tr><td>init=</td><td>&quot; & rs(&quot;init&quot;)& &quot;</td></tr>&quot;
response.write(&quot;<tr><td>dept=</td><td>&quot; & rs(&quot;dept&quot;)& &quot;</td></tr>&quot;
wend
response.write(&quot;</table>&quot;)
conn.close
set conn = nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top