Question : Removing Quotes From DB Fields

I want to remove a bunch of quotation marks (") from some fields in a sql server 2000 table from within an asp page.  When I enter the " in the <input> to tell it what to delete from the fields it disappears.  I have tried the double quotation marks ("") as an escape but that isn't working either.  Is there another approach?

Answer : Removing Quotes From DB Fields

You can do it one of two ways if I understand you correctly.

1,

Use a function like this:

function RemoveQuotes(objval)
  if trim(objval)      = "" then
  RemoveQuotes      = "''"
  else
   objval      = replace(objval,"'","''")
   objval      = replace(objval,"""","''")
   RemoveQuotes  = "'" & trim(objval) & "'"
 end if
end function

and call it like this:

RemoveQuotes(formfieldname)

or simply:

replace(request(formfieldname,"'","''"))

Random Solutions  
 
programming4us programming4us