Handling restricted characters in a table

new BookmarkLockedFalling
mikegann
New Member
*

mikegann Avatar

Posts: 27

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
davos1
Guest

Guest Avatar

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


davos1
Guest

Guest Avatar

mikegann
New Member
*

mikegann Avatar

Posts: 27