SQL - saving strings with single quotes included
Posted on 1998-12-18
in my vb app, I'm using sql statements to save data to an access db table. One field in particular is a memo field which is used for comments. When I'm constructing my sql statement I get errors because of the way single quotes are used. If single quotes are used in the memo field (e.g, this is credit's responsibility), when it is used in the sql statement (e,g, strSQL="Update tblInfo SET memofield = '" & txtmemo.text & "';"), an error is received because of the single quote in the text being saved. How do I overcome this problem, without preventing the user from entering single quotes in the memo field.