SQLite question

I have a database which also stores big pieces of text. When the text is entered the first time, inclusive special characters, it always writes it correctly, without any error into the database.
When I edit the text and want to update the database it struggles with the special characters and generates: ERROR: 1 Msg :near “writing”: syntax error

I searched in a text editor for the word writing and only found it twice between single quotes. (‘writing’) I removed the single quotes around the words, but then it struggles with another special character.

When I want to update the text from the textbox I put the whole block of text between 2 single quotes too, because I thought it would accept the whole block than.

However, my question is: when writing a new record with special characters in the block text it is accepted and why does update not accept this. Is there a way to get around it? I tried so many things, but all failed.


Use Prepared Statements… What you are doing is not only difficult for special characters, but can lend it self to SQL Injection which can allow malicious attacks

There are plenty of topics on this forum dealing with Prepared Statements, as well as the Xojo docs.