[thelist] Apostrophes
Rob Smith
rob.smith at thermon.com
Fri May 31 15:31:00 CDT 2002
--
[ Picked text/plain from multipart/alternative ]
Hey this is interesting:
I've got a <textarea></textarea> and a snippet of ASP code for you to look
at.
----------------------------
| This isn't a message. |
| |
|__________________________|
strSQL = "INSERT INTO CMSSocial (CMSSocialTitle, CMSSocialBody,
CMSSocialEdited, CMSSSubmit, CMSUserID, CMSEditorID) VALUES (' " &
strTitle & " ', ' " & strBody & " ', ' " & strEdited & " ', ' " & strSubmit
& " ', ' " & findit.Fields.item("CMSUserID").value & " ', ' " &
findit2.Fields.item("CMSUserID").value & " ')"
When I try to do the SQL command I get an error saying:
Line 1: Incorrect syntax near 't'.
Which means when the code tries to insert this message into the database, it
gets hung up on the apostrophe and pukes.
Any ideas how I can allow my users to include conjunctions? Do I need to
change up the order of my apostrophes?
(Jay said: you need to escape the apostrophe's. ) No offence Jay, Other
ideas?
Rob
More information about the thelist
mailing list