none
How to deal with char(') in a SELECT RRS feed

  • Question

  • Hi

    I have a line code 

    foundRows = DT.Select("Commune='" & Commune & "' And " & DC.ToString & "='" & sChamp & "'")

    that works fine except when the string Commune contains a ' like "Mc'Claus"

    How to deal with it ?

    Thanks

    Bernard


    Bernard Bouree

    dimanche 15 mai 2016 13:53

Réponses

  • Hi Bernard,

    Just to make sure you are aware that you posted in English in the French Forum.... French would work here best I'd think.

    C'est 2 '' qu'il faut utiliser:

    Dim strSQLText As String = "Commune='" & Replace(Commune, "'", "''") & " AND " & DC.Tostring & "='" & sChamp & "'")

    dimanche 15 mai 2016 15:54

Toutes les réponses