Replace Single Quotes

This script will replace single quotes so the data is SQL-safe

CodeFunctionName
What is this?

Public

Not Tested

Original Work
<%
Function fncReplaceSingleQuotes( ByVal strToReplace )
On Error Resume Next
Const Proc = "fncReplaceSingleQuotes"

strToReplace = Replace(strToReplace, "'", "''")

fncReplaceQuote = strToReplace

If err.Number < > 0 then
Call subWriteError(err.Number, Proc, err.Description)
End if

End Function
'
' ...
'
strVar = Request.Form("txtField1")
strVar = fncReplaceSingleQuotes(strVar)
% >

Views 4,583

Downloads 1,470

CodeID
DB ID

JeffSmith
26
Revisions

v1.0

Monday
April
16
2018