Forum Moderators: open
Function StoDB(data)
Dim returnVal
returnVal = "'" & Trim(Replace(data, "'", "''")) & "'"
If returnVal = "''" Then returnVal = "null"
StoDB = returnVal
End Function
What can I add so that it will handle double quotes as well?
Thanks,
Kevin
ASP can run both languages, so why not try that - use a Javascript function to convert the quotes, then the rest in VB.
You could even do it client side first, on the Submit event.
Quotes are a nuisance for sure.
<input type=text name="CONTACT_EMAIL" value="<%= CONTACT_EMAIL %>">
Once I removed the quotes from around the value like this
<input type=text name="CONTACT_EMAIL" value=<%= CONTACT_EMAIL %>>
the display page showed the quote fine. It was truncating the value at the quote mark in the field due to the opening quote mark value="<%= CONTACT_EMAIL %>">
Thanks everyone for your help!