On Sun, Apr 17, 2011 at 3:54 PM, Alan Holbrook <isaac.laqu...@gmail.com> wrote:
> I'm using SQLite with VBE2008.  I've defined a table with a number of text
> fields in it.  If the information I want to write to the database contains
> an embedded apostrophe, the program throws an error.  That is, if I set
> textfield1 to *Going Down the Road Feeling Bad*, the data gets written
> correctly and the program continues.  But if I set textfield1 to *Goin' Down
> the Road Feelin' Bad*, I get an error.
>
> Is there a way I can use an apostrophe in the data to be written?

I'm guessing you're making a statement like INSERT INTO foo
VALUES('Goin' Down the Road Feelin' Bad'), which obviously won't work.
 You should instead use prepared statements, which do not have this
problem.  An alternative is to escape your input, but that is still
error-prone and slower.

-- 
Cory Nelson
http://int64.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to