HELP:: Simple Search Box in ASP.

Thread Solved

Join Date: Feb 2009
Posts: 16
Reputation: dhavalcoholic is an unknown quantity at this point 
Solved Threads: 0
dhavalcoholic dhavalcoholic is offline Offline
Newbie Poster

HELP:: Simple Search Box in ASP.

 
0
  #1
Sep 20th, 2009
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.

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

I am getting the following error:

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

Can any one help me remove it?

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 23
Reputation: chsab420 is an unknown quantity at this point 
Solved Threads: 5
chsab420 chsab420 is offline Offline
Newbie Poster

Re: HELP:: Simple Search Box in ASP.

 
0
  #2
Sep 28th, 2009
i dont see anything wrong
can u post html as well
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 16
Reputation: dhavalcoholic is an unknown quantity at this point 
Solved Threads: 0
dhavalcoholic dhavalcoholic is offline Offline
Newbie Poster

Re: HELP:: Simple Search Box in ASP.

 
0
  #3
Sep 28th, 2009
@ 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.
Reply With Quote Quick reply to this message  
Reply

Tags
asp, searchbox, selectoption

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for asp, searchbox, selectoption
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC