Link to home
Start Free TrialLog in
Avatar of TransBind
TransBind

asked on

single quote ASCII

I am trying to pass to an update SQL statement a textfield value which might contain a single quote and this generate an error.
How can I convert a single quote into an ASCII character in a string "adfd  '  fd". Basically I would like to go through every character in a string and convert single quote character into a special character that will be accepted by SQL.
Avatar of TransBind
TransBind

ASKER

seems like it works out if I replace single quote with two singles quotes. is this a good approach? any suggestions are welcomed. thank u.
ASKER CERTIFIED SOLUTION
Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try this..also..

strSQL="insert into table_name values"strSQL=strSQL & "(NAME='"strSQL=strSQL & replace(request("NAME"),"'","''") & "'," & request("DoB") & ")"In the above example if the value of the name field contains a single quote it will be replaced with two single quotes.

R.K