|
Post by mikegann on Jun 29, 2009 15:15:54 GMT -5
I have an application that stores some free form text entry in a SqLite database. When an apostrophe (') is present this causes a syntax error when I execute the database write.
How is this situation normally handled?
Search and replace the restricted characters in the string before the database write and the reverse when the data is retrieved?
Is there a list of other problematic characters?
Thanks,
Mike
|
|
|
Post by davos1 on Jun 29, 2009 18:16:19 GMT -5
problems: all other unicode characters. like - ' etc. in a case like: john's composed-name...
mhm, i think that I used that dblQuote$(str$)...
insert into xtable(a, b ,c) values ('";dblQuote$(a$);"','";dblQuote$(b$);"','";dblQuote$(c$);"')"
FUNCTION dblQuote$(str$) i = 1 qq$ = "" while (word$(str$,i,"'")) <> "" dblQuote$ = dblQuote$;qq$;word$(str$,i,"'") qq$ = "''" i = i + 1 WEND END FUNCTION
|
|
|
Post by davos1 on Jun 29, 2009 18:16:50 GMT -5
also replace that - that comes in some names...
|
|
|
Post by mikegann on Jun 30, 2009 17:47:16 GMT -5
Thanks for that. Hopefully in the next few days I'll have time to get back on that project and implement that function.
Best regards,
Mike
|
|