k my problem is always the same....1. evrything seems to be rigth and no error is coming up but the whole if loop or also case is ignored
2. an expected statement error message is coming up
here is my code if u can help me would be nice...really
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%@LANGUAGE="VBScript"%>
<!-- #INCLUDE VIRTUAL="adovbs.inc" -->
<%If Request("tablename"="" Then%>
<title>main</title>
<body bgcolor="#0066FF" text="#FFFFFF">
<p><b><font size="+2">Please choose a table you want to display:</font></b></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form name="form1" method="post" action="b.asp">
<div align="center">
<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>
<input type="submit" name="Button" value="Submit">
</div>
</form>
<%Else
DIM tablename
DIM SQLQuery
tablename = Request.Form("tablename"
set myConnection = Server.CreateObject("ADODB.Connection"
myConnection.Open "DSN=ph;UID=sa"
SQLQuery = "select * from " & tablename %>
<% If Request.QueryString(SQLQuery)="select * from item" Then
SQLQuery = "select item_id,descr,serial from item"%>
<% elseif Request("SQLQuery"="select * from cust" Then
SQLQuery = "select cust_id,descr,address,phone from cust"%>
<% elseif Request("SQLQuery"="select * from prod" Then
SQLQuery = "select prod_id,descr from prod"%>
<% elseif Request("SQLQuery"="select * from site" Then
SQLQuery = "select site_id,descr,address from site"%>
<%else%>
nix
<%end if%>
<%end if%>
<%end if%>
<%end if%>
<% set RSTitleList = myConnection.Execute(SQLQuery)%>
<p> </p>
<table cellpadding=2 cellspacing=0 border=0 bordercolor="#000000" bgcolor="#FFCCCC">
<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
end if
%>
</table>
</head>
caz [sig][/sig]
2. an expected statement error message is coming up
here is my code if u can help me would be nice...really
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%@LANGUAGE="VBScript"%>
<!-- #INCLUDE VIRTUAL="adovbs.inc" -->
<%If Request("tablename"="" Then%>
<title>main</title>
<body bgcolor="#0066FF" text="#FFFFFF">
<p><b><font size="+2">Please choose a table you want to display:</font></b></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form name="form1" method="post" action="b.asp">
<div align="center">
<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>
<input type="submit" name="Button" value="Submit">
</div>
</form>
<%Else
DIM tablename
DIM SQLQuery
tablename = Request.Form("tablename"
set myConnection = Server.CreateObject("ADODB.Connection"
myConnection.Open "DSN=ph;UID=sa"
SQLQuery = "select * from " & tablename %>
<% If Request.QueryString(SQLQuery)="select * from item" Then
SQLQuery = "select item_id,descr,serial from item"%>
<% elseif Request("SQLQuery"="select * from cust" Then
SQLQuery = "select cust_id,descr,address,phone from cust"%>
<% elseif Request("SQLQuery"="select * from prod" Then
SQLQuery = "select prod_id,descr from prod"%>
<% elseif Request("SQLQuery"="select * from site" Then
SQLQuery = "select site_id,descr,address from site"%>
<%else%>
nix
<%end if%>
<%end if%>
<%end if%>
<%end if%>
<% set RSTitleList = myConnection.Execute(SQLQuery)%>
<p> </p>
<table cellpadding=2 cellspacing=0 border=0 bordercolor="#000000" bgcolor="#FFCCCC">
<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
end if
%>
</table>
</head>
caz [sig][/sig]