| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Help with SQL statement!|
apostrophes and quotation marks
i have a string variable(txtmessage)
txtmessage has both apostrophes and quotation marks
my insert statement looks like this:
strSQL = "INSERT INTO MYTABLE (MESSAGE) VALUES (" & TXTAMESSAGE & ")"
fails every time. i must be able to allow both quotes and apost... but how?
Try using square bracket delimiters:
[" & TXTAMESSAGE & "]
if that doesn't work search MS or online re: microsoft access delimiters or similar.
Try replacing each apostrophe in the string variable with two consecutive apostrophes.
In vbscript I think the function is: txtmessage=replace(txtmessage,"'","''")
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved