i have modified the changes suggested in the previous reply, which i have done. Below is the code. if it is correct then why am i getting the error on line 27. one other thing what is mean by len used in if len(). The changes made shouldn't effect rest of the code should it
-------------------------------------------------------------------
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("fpdb/coursework.mdb"))
product =request.Form("product")
%>
<form method="post">
<table border="1" width="194" id="table1">
<tr>
<td width="20"><input type="checkbox" name="product" value="101"></td><td width="63">Something</td>
<td width="20"><input type="checkbox" name="product" value="102"></td><td width="63">Milk</td>
<td width="20"><input type="checkbox" name="product" value="103"></td><td width="63">Milk</td>
<td width="20"><input type="checkbox" name="product" value="104"></td><td width="63">Something</td>
<td width="20"><input type="checkbox" name="product" value="105"></td><td width="28">Milk</td>
<td width="20"><input type="checkbox" name="product" value="106"></td><td width="63">Something</td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<%
21) if len(request.form("product")) > 0 then
22) sql = "SELECT product.ProductName, product.ProductType, product.ProductDescription, "
23) sql = sql &" Prices.Asda, Prices.Tesco, Prices.Safeway, Prices.Sainsbury"
24) sql = sql &" FROM "
25) sql = sql &" Prices INNER JOIN product ON Prices.ProductId = product.ProductId"
26) sql = sql &" WHERE"
27) sql = sql &" product.productid in ("&request.form("product")&)
28) set rs=Server.CreateObject("ADODB.Recordset")
29) rs.Open sql,conn
%>
<p> </p>
<table width="62%" cellspacing="0" cellpadding="2" border="1">
<tr>
<th width="138" style="border-style: solid; border-width: 1px">
<font size="4">Product Name</font></th>
<th style="border-style: solid; border-width: 1px"><font size="4">Product Description</font></th>
<th width="55" style="border-style: solid; border-width: 1px">
<font size="4">Asda (£)</font></th>
<th width="65" style="border-style: solid; border-width: 1px">
<font size="4">Tesco (£)</font></th>
<th width="79" style="border-style: solid; border-width: 1px">
<font size="4">Sainsbury (£)</font></th>
<th width="72" style="border-style: solid; border-width: 1px">
<font size="4">Safeway (£)</font></th>
</tr>
<%
do until rs.EOF
response.write("<tr>")
response.write("<td>" & rs.fields("productname") & "</td>")
response.write("<td>" & rs.fields("productdescription") & "</td>")
response.write("<td>" & rs.fields("asda") & "</td>")
response.write("<td>" & rs.fields("tesco") & "</td>")
response.write("<td>" & rs.fields("sainsbury") & "</td>")
response.write("<td>" & rs.fields("safeway") & "</td>")
response.write("</tr>")
rs.MoveNext
loop
rs.close
conn.Close
set rs=Nothing
set conn=Nothing
end if
%>
</table>
</body>
</html>
------------------------------------------------------------------------
Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/db206/project/checkproduct.asp, line 27, column 61