I'm trying to upload some text to a basic CMS but am having problems whenever a "double quote" is included. I've run a replace function which elminates 'single qoutes' which works fine but I can't for teh life of me me see why the double are creating a problem.
my replace function is as follows:
function fixQuotes(strData)
fixQuotes=Replace(strData,chr(39),chr(39) & chr(39))
fixQuotes=Replace(fixQuotes,"dog","cat")
fixQuotes=Replace(fixQuotes,chr(34),chr(34) & chr(34))
fixQuotes=Replace(fixQuotes,"""", "\""", 1, -1, 1)
fixQuotes=replace(fixQuotes, chr(34), "”")
fixQuotes=Replace(fixQuotes,"boy", "girl")
end function
(as you can see I've tried everyting)
and the portion of code that is supposed to prepare my SQL statement is :
body = fixQuotes(request.form("body"))
title = fixQuotes(request.form("title"))
SQLstmt = "UPDATE Messages Set Title = '"& title & "',"
SQLstmt = SQLstmt & "Description='" & desc & "',"
SQLstmt = SQLstmt & "body='" & body & "',"
SQLstmt = SQLstmt & "startdate='" & MediumDate(Startdate) & "',"
SQLstmt = SQLstmt & "enddate='" & MediumDate(Enddate) & "',"
SQLstmt = SQLstmt & "alert='" & Alert & "' "
SQLstmt = SQLstmt & "WHERE ID='" & request.form("ID") & "'"
Set RS = objConn.execute(SQLstmt)
Any help would stop me from going mad and kicking my cat...again.