Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Quote" Headache

Status
Not open for further replies.

JGresko

Programmer
Apr 24, 2002
86
US
I have a form that has a small free form text field that needs to be used as a search field. My problem is that usesr are putting names in like James "Jim" Smith and 5'4" male (no it's not a dating service)

The single quote (') I'm handling with

Code:
Name = rsName("cssname")
Dim found, char, txt
char = "'"
txt = Name
Call findChar(char, txt)     
If found Then
    Name = ReplaceTest(Name, "'", "''")    
End If

How can I check for a double quote(") to catch it before it blows up my SQL search string?

 
what is your sql statment that u have not mentioned
i dont think so it will blow up ....

 
I think I found the problem... well part of it

\ should work as the escape char, but my Recordset.ASP seems to be corrupted which is why I'm getting weird results... like remote scripting's been turned off.

I'm off to putter with my code... or kick it... same diff

 
If you want to just duplicate your code from above, set char = """"
The middle set of quotes turns into a single double quote (ASP escape character)
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top