Page 1 of 1

For info: Apostrophes & SQLite

Posted: Thu Mar 03, 2022 3:08 pm
by glenn9
Dear all,

Just in case anyone else encounters a similar headache - SQLite will not add text containing an apostrophe (').

After encountering a problem where seemingly for random reasons text was not being stored by SQLite by (a lot) of trial and error I discovered that it text containing an apostrophe that was causing the problem!

(this link provided the answer: https://stackoverflow.com/questions/191 ... ngle-quote).

It seems that it is easily solved by 'doubling up' the apostrophe - which is easy in LC:

Code: Select all

replace "'" with "''" in fld"fQuestion"
Glenn

Re: For info: Apostrophes & SQLite

Posted: Thu Mar 03, 2022 5:21 pm
by dunbarx
Glenn.

I have fooled around with this sort of thing before, sometimes to substitute a common character, and sometimes to get around a limitation similar to what you are dealing with.

These chars, numToChar(212) and numToChar(213) both look like the apostrophe. You do not need the double char, which is off-putting when read.

Craig