Advertisement
4_2005-2006 Databases/ Data Access/ DAO/ ADO #151642

Fix Apostrophe in strings for SQL query

Fix Apostrophe in strings for SQL query

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
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

Upload
Původní komentáře (3)
Obnoveno z Wayback Machine