Aggiunti caratteri di escape se nel campo Note vengono inseriti i caratteri \, ', ", %

This commit is contained in:
RenzoL
2022-01-12 16:01:25 +01:00
parent 68bf33efae
commit 42e5788d40
7 changed files with 21 additions and 18 deletions
+3 -1
View File
@@ -322,7 +322,9 @@ Public Class UpdateKeyPageVM
End If
If Not IsNothing(Note) Then
' Aggiorno tabella Key con KeyDate scelto
Dim Query As String = "UPDATE " & DB_KEY & " SET " & DB_NOTE & " = '" & m_Note & "' WHERE " & DB_LOCKID & " = '" & Key.LockID & "' "
Dim Query As String = "UPDATE " & DB_KEY &
" SET " & DB_NOTE & " = '" & m_Note.Replace("\", "\\").Replace("'", "\'").Replace("""", "\""").Replace("%", "\%") &
"' WHERE " & DB_LOCKID & " = '" & Key.LockID & "' "
Query = Query.TrimEnd(","c, " "c)
ManageDb.ExecuteQuery(Query)