Click to See Complete Forum and Search --> : ref quote inside quote


lcscne
04-08-2004, 06:38 PM
whats the proper method for refferencing a quote inside quotation marks?


strModHead = Replace(Request.Form("contentHead"), Chr(34), "& quot;")

strModHead = Replace(strModHead, Chr(39), "& rsquo;")


Can anyone tell me why this code doesn't work? or maybe let me know if there is a VBScript function that returns the ASCII value of passed in char so I can check to make sure that the char I'm checking is indeed 34 and 39?

Thanks.

added spaces (&_) for this post

lcscne
04-08-2004, 07:11 PM
sorry, answered my own question, this works properly:


strModHead = Replace(Request.Form("contentHead"), Chr(34), "& #34;")
strModHead = Replace(strModHead, Chr(39), "& #39;")


for use when your sql string may contain a quote inside a field value.