New to using ASP

A

apgoodb

I think this should be quite easy; however, I am having problems. I
want to build a page that takes information from an SQL query and puts
the names in a list box. From this box the user can select which
"Market" they wish to use and then they can select one of a few links
to different reports. These reports however, filter on which "Market"
they selected. My problem is I don't know how to store the Market
value in the session. Here is the code I have so far. Any help would
be appreciated.
Thanks,

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<!--#include virtual="/checkit/Functions.asp"-->
<%
If Session("UserName")="" Then
Response.Redirect("log_in.asp")
ElseIf Session("Client")="" Then
Response.Redirect("client_list.asp")
End If

%>


<html>
<head>
<title>Untitled Document</title>
</head> <body bgcolor="#FFFFFF">

<body bgcolor="#FFFFFF">
<table width="100%" border="0">
<tr>
<td width="15%">&nbsp;</td>
<td width="30%">&nbsp;</td>
<td width="10%">&nbsp;</td>
<td width="30%">&nbsp;</td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="15%">&nbsp;</td>
<td bgcolor="#99CCCC" width="30%"
background="green_fade.gif"><b>Available
Markets:</b></td>
<td width="10%">&nbsp;</td>
<td width="30%" background="green_fade.gif"><b>Reports:</b></td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="15%" rowspan="7">&nbsp;</td>
<td width="30%" rowspan="7">
<form method="POST" action="markets.asp" name="frmSelectMarket">
<select name="lstMarket" size="10">
<%
'set up query and display values
Dim conn, mySurveyList, rs, sql
Set conn = Server.CreateObject("ADODB.Connection")
conn.open Session("ConnectionString")

sql = "SELECT [market_master].[market_id],
[market_master].[market_name] FROM ([market_master] INNER JOIN
[evaluator] ON [market_master].[evaluator_id] =
[evaluator].[evaluator_id]) WHERE [evaluator].[evaluator_id]='" &
SQLString(Session("Client")) & "';"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
Do Until rs.EOF %>
<option value="<%=Server.HTMLEncode(rs.Fields("market_id").Value)%>"><%=Server.HTMLEncode(rs.Fields("market_name").Value)%></option>
<%rs.MoveNext
Loop

rs.close
set rs=Nothing
conn.close
set conn=nothing
%>
'link to reports
</select>
</form>
</td>
<td width="10%">&nbsp;</td>
<td width="30%"><name="submit"><a href="overall.asp">Overall
Performance</a></td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="10%">&nbsp;</td>
<td width="30%"><a href="financial.asp">Financial
Stability</a></td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="10%">&nbsp;</td>
<td width="30%"><a href="health.asp">Health and Wellness</a></td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="10%">&nbsp;</td>
<td width="30%"><a href="satisfaction.asp">Satisfaction and
Access</a> </td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="10%">&nbsp;</td>
<td width="30%"><a href="utilization.asp">Utilization</a></td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="10%">&nbsp;</td>
<td width="30%"><a href="utilization.asp">Maps</a></td>
<td width="15%">&nbsp;</td>
</tr>
<tr>
<td width="10%">&nbsp;</td>
<td width="30%">&nbsp;</td>
<td width="15%">&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
 

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,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top