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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Quote" headaches

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?
 
Whoops... I meant to post this to the regular ASP forum (not .NET)
 
Can't you just escape it using \" instead of just " ?
 
U can also try using the chr() function with the ascii value of the ". NetAngel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top