Question : ASP/VB Single Quote Replacement

Hi - I am having an issue with replacing single quotes on a classic ASP page. I have several different pages done by different developers in the past. I was able to do the following replacment that works just fine on my page...

  szStrength = Request.Form("Strength")
  szStrength = Replace(Request.form("Strength"),"'","'")
  szImprove = Request.Form("Improve")
  szImprove = Replace(Request.form("Improve"), "'", "'")
  szOther = Request.Form("Comments")
  szOther = Replace(Request.form("Comments"), "'", "'")

but I have 2 other pages that I can't figure out how to do the same with

Insert

    sql=sql & "'" & Request.QueryString("strength") & "',"
    sql=sql & "'" & Request.QueryString("improve") & "',"
    sql=sql & "'" & Request.QueryString("other")& "')"

Update

    sql=sql & "Strength='" & Request.QueryString("strength") & "',"
    sql=sql & "Improve='" & Request.QueryString("improve") & "',"
    sql=sql & "Comments='" & Request.QueryString("other") & "' "

I'm looking for a quick fix to do the same replacement on these 2 pages, any suggestions?

Answer : ASP/VB Single Quote Replacement

Unless there's something I'm missing...

Insert

   sql=sql & "'" & Replace(Request.QueryString("strength"),"'","'") & "',"
   sql=sql & "'" & Replace(Request.QueryString("improve"),"'","'") & "',"
   sql=sql & "'" & Replace(Request.QueryString("other"),"'","'") & "')"

Update

   sql=sql & "Strength='" & Replace(Request.QueryString("strength"),"'","'") & "',"
   sql=sql & "Improve='" & Replace(Request.QueryString("improve"),"'","'") & "',"
   sql=sql & "Comments='" & Replace(Request.QueryString("other"),"'","'") & "' "

Random Solutions  
 
programming4us programming4us