i want to get the values if one is selected in a listbox menu in a variable
but its not working...the variable is always empty....
here is the code
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%@LANGUAGE="VBScript"%>
<!-- #INCLUDE VIRTUAL="adovbs.inc" -->
<form name="form1">
<select name="tablename" size="4">
<option value="item" selected>item</option>
<option value="cust" >cust</option>
<option value="prod" >prod</option>
<option value="site" >site</option>
</select>
<%
DIM tablename
SELECT CASE Request.Form("item"
CASE Request.Form("item"
tablename = Request.Form("cust"
CASE Request.Form("cust"
tablename = Request.Form("prod"
CASE Request.Form("prod"
tablename = Request.Form("prod"
CASE Request.Form("site"
tablename = Request.Form("site"
END SELECT
%>
<input type="submit" name="Button" value="Submit">
</form>
<%
set myConnection = Server.CreateObject("ADODB.Connection"
myConnection.Open "DSN=ph;UID=sa"
SQLQuery = "select * from " & tablename
set RSTitleList = myConnection.Execute(SQLQuery)%>
<p> </p>
<table cellpadding=2 cellspacing=0 border=1>
<tr bgcolor="#cccccc">
<% for each field in RSTitleList.Fields %>
<th><%=field.Name%></th>
<% next %>
</tr>
<% WHILE NOT RSTitleList.EOF %>
<tr>
<% for each field in RSTitleList.Fields %>
<td><small><%=field.Value%></small></td>
<% next %>
</tr>
<%
RSTitleList.MoveNext
Wend
%>
</table>
</head>
please help dont know...what do to
caz [sig][/sig]
but its not working...the variable is always empty....
here is the code
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%@LANGUAGE="VBScript"%>
<!-- #INCLUDE VIRTUAL="adovbs.inc" -->
<form name="form1">
<select name="tablename" size="4">
<option value="item" selected>item</option>
<option value="cust" >cust</option>
<option value="prod" >prod</option>
<option value="site" >site</option>
</select>
<%
DIM tablename
SELECT CASE Request.Form("item"
CASE Request.Form("item"
tablename = Request.Form("cust"
CASE Request.Form("cust"
tablename = Request.Form("prod"
CASE Request.Form("prod"
tablename = Request.Form("prod"
CASE Request.Form("site"
tablename = Request.Form("site"
END SELECT
%>
<input type="submit" name="Button" value="Submit">
</form>
<%
set myConnection = Server.CreateObject("ADODB.Connection"
myConnection.Open "DSN=ph;UID=sa"
SQLQuery = "select * from " & tablename
set RSTitleList = myConnection.Execute(SQLQuery)%>
<p> </p>
<table cellpadding=2 cellspacing=0 border=1>
<tr bgcolor="#cccccc">
<% for each field in RSTitleList.Fields %>
<th><%=field.Name%></th>
<% next %>
</tr>
<% WHILE NOT RSTitleList.EOF %>
<tr>
<% for each field in RSTitleList.Fields %>
<td><small><%=field.Value%></small></td>
<% next %>
</tr>
<%
RSTitleList.MoveNext
Wend
%>
</table>
</head>
please help dont know...what do to
caz [sig][/sig]