Fix Apostrophe in strings for SQL query
Fix Apostrophe in strings for SQL query
Inputs
String as input to the function
Returns
Returns the modified string
Rate Fix Apostrophe in strings for SQL query
(3(3 Vote))
Function Fix_Apostrophe(ByVal S As String) As String
Dim i As Integer, ch As String, Ret As String
If IsNull(S) Then Exit Function
Ret = ""
For i = 1 To Len(S)
ch = Mid$(S, i, 1) ' the current charcater
Ret = Ret & ch
' If the character is a single quote add a second one.
If ch = "'" Then
Ret = Ret & ch
End If
Next
Fix_Apostrophe = Ret
End Function
Fix Apostrophe in strings for SQL query Comments
No comments yet — be the first to post one!
Post a Comment