p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: Concatenation Question


Message #1 by "Andrew Cooper" <aecooper@i...> on Thu, 8 Aug 2002 12:50:28 -0400
Add the following function to your page you can then call it to replace a 
single quote with two single quotes you could also add more lines to the 
function to replace any other characters

<%
Function CleanSQL(strValue)
  Dim strTemp
  strValue=Replace(strValue, "'","''")

  CleanSQL=strValue
End Function


description=request("description")
description =cleanSQL(description)

strSQL = "insert into TABLE ('" & description & "')"

%>
something like this should work - just keep adding other values to the 
insert statement

  Return to Index