What is the best way to make use of single quotes like it's, don't, can't etc?
If I type in the word "it's" as a value for a field, it returns an error that says "syntax error near s.
Once I remove the single quote, it works but we need the single quotes.
What do I include to the field ItemDesc in the insert statement below for the client to be able to type in words like can't, don't it's etc without getting an error?
Thanks in advance
'insert the Item Descriptions, from grid
For x = 0 To intCount
If request.form("txtItemDesc"&x) <> "" then
strItemDesc = request.form("txtItemDesc"&x)
else
strItemDesc = "N/A"
end if
strSQL = "INSERT INTO cart( "
strSQL = strSQL & "ItemDesc) "
strSQL = strSQL & "VALUES( "
strSQL = strSQL & "'"&strItemDesc&"')"
'response.write(strSQL)
'response.end
response.write("<br>"
objConn.execute(strSQL)
Next
If I type in the word "it's" as a value for a field, it returns an error that says "syntax error near s.
Once I remove the single quote, it works but we need the single quotes.
What do I include to the field ItemDesc in the insert statement below for the client to be able to type in words like can't, don't it's etc without getting an error?
Thanks in advance
'insert the Item Descriptions, from grid
For x = 0 To intCount
If request.form("txtItemDesc"&x) <> "" then
strItemDesc = request.form("txtItemDesc"&x)
else
strItemDesc = "N/A"
end if
strSQL = "INSERT INTO cart( "
strSQL = strSQL & "ItemDesc) "
strSQL = strSQL & "VALUES( "
strSQL = strSQL & "'"&strItemDesc&"')"
'response.write(strSQL)
'response.end
response.write("<br>"
objConn.execute(strSQL)
Next