Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


double quotes "

Posted on 2004-08-15
Medium Priority
Last Modified: 2010-05-18
i've been getting a  Missing operand before '&' operator error.

my code needs to be  for example :
dv.RowFilter = "name LIKE '*david*'"

right now i'm trying to pass two variables i got from a form into that statement:

dim searchfrm = Request.Form("searchfrm")
dim searchval = Request.Form("searchval")

searchstr = """ + searchfrm + " " + "LIKE" + " " + "'*" + searchval + "*'" + """
dv.RowFilter = searchstr

However, this does not work.. I get the Missing operand before '&' operator error.
I tried Response.Write(searchstr), it displays the statement i want correctly but why wouldn't it work as a complete statement??

please help!! really urgent
Question by:lewin85_sg
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 11803712
searchstr = """ + searchfrm + " " + "LIKE" + " " + "'*" + searchval + "*'" + """
dv.RowFilter = searchstr

Instead of " try chr(34)


searchstr = chr(34) & searchfrm & " LIKE " & "'*" & searchval & "*'" & chr(34)
dv.RowFilter = searchstr

And i'm not sure about the *

Better would be:

searchstr = chr(34) & searchfrm & " LIKE " & "'%" & searchval & "%'" & chr(34)
dv.RowFilter = searchstr

I've never seen this RowFilter function before, so this may not help.

Accepted Solution

j2nku earned 2000 total points
ID: 11803717
Maybe the best way would be

searchstr = searchfrm & " LIKE " & "'%" & searchval & "%'"

Author Comment

ID: 11803737
thank you^^ that worked

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question