double quotes "

Posted on 2004-08-15
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

Comment Utility
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 500 total points
Comment Utility
Maybe the best way would be

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

Author Comment

Comment Utility
thank you^^ that worked

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now