Allow punctuation in a query string

Posted on 2004-11-15
Last Modified: 2008-07-03
I want to allow the use of an apostrophe in my query string as follows:

resultCriteria = Request.Form(Item)
resultCriteria = Replace(resultCriteria,"'","'''")    

sqlString = "EXEC spSearchMerchants '" & resultCriteria & "'"
Question by:RonNeiger
    LVL 8

    Accepted Solution

    Erm, what's the question?  Is it not working for you?  Looks like you have an extra apostrophe in line 2 (should be "''" instead of "'''").

    resultCriteria = Replace(resultCriteria,"'","''")

    Author Comment

    Thank you that worked fine

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    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…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    755 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

    19 Experts available now in Live!

    Get 1:1 Help Now