I got error of Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
/searchmobiles.asp, line 88
How i solve the error.i don't solve it.pls help me.its urgent,
i attached the code below.
i am using classic ASP using vs 2008.database ms access 2007 and vbscript
[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
/searchmobiles.asp, line 88
How i solve the error.i don't solve it.pls help me.its urgent,
i attached the code below.
i am using classic ASP using vs 2008.database ms access 2007 and vbscript
<%@ Language="VBScript" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Hello World</title> <link href="hello-world-style.css" rel="stylesheet" type="text/css" /> </head> <body> <% set cn=server.createObject("ADODB.Connection") cn.mode=3 cn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db\mobiles.mdb") %> <% if request.form("all") = "on" then mysql="select *from nokia" elseif Request.Form("nokia") = "on" and Request.Form("samsung") = "on" then mysql="select *from nokia,samsung " elseif Request.Form("nokia") = "on" then mysql="select *from nokia" elseif Request.Form("samsung") = "on" then mysql="select *from samsung" elseif Request.Form("sony") = "on" then mysql="select *from sony" elseif Request.Form("blackberry") = "on" then mysql="select *from blackberry" elseif Request.Form("htc") = "on" then mysql="select *from htc" elseif Request.Form("apple") = "on" then mysql="select *from apple" end if mysql = mysql + "where nokia.mprice = samsung.mprice2 between " + request.form("pricerangefrom") + " and " + request.form("pricerangeto") + " and " if request.form("android") = "on" then mysql = mysql + " os like 'Android%' and " else mysql = mysql end if if request.form("symbian") = "on" then mysql = mysql + " os like 'Symbian%' and " else mysql = mysql end if if request.form("windows") = "on" then mysql = mysql + " os like 'Windows%' and " else mysql = mysql end if if request.form("bada") = "on" then mysql = mysql + " os like 'Bada%' and " else mysql = mysql end if if request.form("gprs") = "on" then mysql = mysql + " gprs <> 'NO' and " end if if request.form("g3") = "on" then mysql = mysql + " g3 <> 'NO' and " end if if request.form("wifi") = "on" then mysql = mysql + " wifi <> 'NO' and " end if if request.form("bluetooth") = "on" then mysql = mysql + " bluetooth <> 'NO' and " end if if request.form("usb") = "on" then mysql = mysql + " usb <> 'NO' and " end if mysql = mysql + "1 = 1 order by mprice asc" set rs1=cn.execute(mysql) midl = rs1(0).value bname = rs1(1).Value mname = rs1(2).Value mprice = rs1(3).Value %> <div class="wrapper"> <!--#include file=header.asp--> <div class="clear"></div> <!--#include file=brands.asp--> <div class="clear"></div> <!--#include file=sub-menu.asp--> <div class="clear"> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/db/mobiles.mdb" SelectCommand="SELECT * FROM [nokia]"> </asp:AccessDataSource> </div> <div class="inside-wrapper"> <div class="left-box"> <form method="POST" action="searchmobiles.asp" name="myform"> <h1>Price</h1> <div class="adv-search-box"> <ul> <li> Price range from<br /> <li><input type="text" name="pricerangefrom" size="8"> to <input type="text" name="pricerangeto" size="8"></li> </ul> </div><!-- categ box ends here --> <div class="clear"></div> <h1>Brands</h1> <div class="adv-search-box"> <ul> <li><input type="checkbox" name="all" value="on"> All Models </li> <li><input type="checkbox" name="nokia" value="on"> Nokia </li> <li><input type="checkbox" name="samsung" value="on"> Samsung </li> <li><input type="checkbox" name="sony" value="on"> Sony Ericsson </li> <li><input type="checkbox" name="blackberry" value="on"> Blackberry </li> <li><input type="checkbox" name="htc" value="on"> HTC </li> <li><input type="checkbox" name="apple" value="on"> Apple </li> <li><input type="checkbox" name="motorola" value="on"> Motorola </li> </ul> </div><!-- categ box ends here --> <div class="clear"></div> <h1>Operating System</h1> <div class="adv-search-box"> <ul> <li><input type="checkbox" name="android" value="on"> Android </li> <li><input type="checkbox" name="symbian" value="on"> Symbian </li> <li><input type="checkbox" name="windows" value="on"> Windows </li> <li><input type="checkbox" name="bada" value="on"> Bada </li> </ul> </div><!-- categ box ends here --> <div class="clear"></div> <h1>Connectivity</h1> <div class="adv-search-box"> <ul> <li><input type="checkbox" name="gprs" value="on"> GPRS </li> <li><input type="checkbox" name="g3" value="on"> 3G </li> <li><input type="checkbox" name="wifi" value="on"> Wi-Fi </li> <li><input type="checkbox" name="bluetooth" value="on"> Bluetooth </li> <li><input type="checkbox" name="usb" value="on"> USB </li> </ul> </div><!-- categ box ends here --> <div class="adv-search-box"> <ul> <li><input type="submit" value="Search my Mobile !!!" name="Submit"></li> </ul> </div><!-- categ box ends here --> <div class="clear"></div> <div class="left-box-bottom"></div> </form> </div><!-- leftbox ends here--> <div class="mid-container-box"> <div class="mid-container-top"></div> <div class="mid-container"> <h2><span><%=bname%></span></h2> <div class="clear"></div> <% If Not rs1.EOF = 0 Then%> <h3>Sorry No Phones are under this category </h3> <%Else counter = 0 While Not rs1.EOF midl = rs1(0).Value bname = rs1(1).Value mname = rs1(2).Value mprice = rs1(3).Value%> <div class="phone-box"> <div class="phone-top"></div> <div class="clear"></div> <div class="phone-box-title"><%=mname%></div> <div class="clear"></div> <div class="new-arrivals-img"><a href="nokia-products.asp?id=<%=midl%>"><img src="products/<%=bname%>/<%=mname%>sml.png" width="90" height="148" alt="new-arrivals-img" /></a></div> <div class="tag-holder"> <div class="price-tag">Rs. <%=mprice%></div> <div class="btn-details"><a href="nokia-products.asp?id=<%=midl%>"></a></div> </div><!--tag holder ends here --> <div class="clear"></div> <div class="phone-bottom"></div> </div><!--phone box ends here --> <% counter = counter + 1 If counter Mod 3 = 0 Then Response.Write("</tr>") End If rs1.MoveNext() Wend if counter = 0 then response.write(" No Records found for your search query...") end if %> <div class="clear"></div> <%End If%> <div class="clear"></div> </div><!--container ends here --><div class="clear"></div> <div class="mid-container-bottom"></div> </div><!-- mid container box ends here --> <div class="clear"></div> </div><!-- inside wrapper ends here--> <div class="clear"></div> <% rs1.Close() cn.Close() %> <!--#include file=footer.asp--> <div class="clear"></div> </div><!--wrapper ends here --> <!--</form>--> <!--#include file=tracking.asp--> </body> </html>