0

Hello friends,

I am trying to make a simple search box in ASP.

I am using a text box, where the user enters his query. And besides it, I am using drop down menu (<select>.. <option>.. </select>) in which the user selects what he want to search (Song name, Artist, Album name, etc).

I am using the following code.

<%
Var = request.Form("sel")
Query = request.Form("query")
sql="Select Title, Artist, Link from Songs where " & Var &" = '" & Query & "'"
response.write(sql)
rs.Open sql, conn
%>

I am getting the following error:

Syntax error (missing operator) in query expression '= '''.

Can any one help me remove it?

Thanks! :)

2
Contributors
2
Replies
33
Views
7 Years
Discussion Span
Last Post by dhavalcoholic
0

@ chsab420

Hello...

Thanks a lot for your reply..

I debugged it by using "If condition"

So if variable is blank....... the sql query is not executed.. !! :)

Have a good day. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.