Go Premium for a chance to win a PS4. Enter to Win


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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

879 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