Function SQL _encode (strcontent) If isnull (strcontent) = false then Strcontent = Replace (strcontent, "," & #34 ;") Strcontent = Replace (strcontent, "'", "& #39 ;") Strcontent = Replace (strcontent, "+", "& #43 ;") Strcontent = Replace (strcontent, "*", "& #42 ;") Strcontent = Replace (strcontent, "-", "& #45 ;") Strcontent = Replace (strcontent, "=", "& #61 ;") Strcontent = Replace (strcontent, "<", "& lt ;") Strcontent = Replace (strcontent, ">", "& gt ;") Strcontent = Replace (strcontent, "%", "& #37 ;") Strcontent = Replace (strcontent, "_", "& #95 ;") SQL _encode = strcontent End if End Function Function SQL _decode (strcontent) If isnull (strcontent) = false then Strcontent = Replace (strcontent, "& #34 ;","""") Strcontent = Replace (strcontent, "& #39 ;","'") Strcontent = Replace (strcontent, "& #43;", "+ ") Strcontent = Replace (strcontent, "& #42 ;","*") Strcontent = Replace (strcontent, "& #45 ;","-") Strcontent = Replace (strcontent, "& #61;", "= ") Strcontent = Replace (strcontent, "& lt;", "<") Strcontent = Replace (strcontent, "& gt;", "> ") Strcontent = Replace (strcontent, "& #37;", "% ") Strcontent = Replace (strcontent, "& #95 ;","_") SQL _decode = strcontent End if End Function Edition 2006 ------------------------------------------------------------------- 'Transform any SQL operators to their ASCII equivalent Function SQL _encode (strcontent) If isnull (strcontent) = false then 'Transform SQL operators to ASCII equivalents Strcontent = Replace (strcontent, "'", "| q | ") Strcontent = Replace (strcontent, "," | QQ | ") Strcontent = Replace (strcontent, "+", "| plus | ") Strcontent = Replace (strcontent, "*", "| star | ") Strcontent = Replace (strcontent, "-", "| minus | ") Strcontent = Replace (strcontent, "=", "| equals | ") Strcontent = Replace (strcontent, "<", "| left | ") Strcontent = Replace (strcontent, ">", "| right | ") Strcontent = Replace (strcontent, "%", "| percent | ") Strcontent = Replace (strcontent, "_", "| under | ") Strcontent = Replace (strcontent, "/", "| backs | ") Strcontent = Replace (strcontent, "/", "| fronts | ") SQL _encode = strcontent End if End Function 'Tranform ASCII characters to their SQL equivalent Function SQL _decode (strcontent) If isnull (strcontent) = false then 'Transform SQL Operators Strcontent = Replace (strcontent, "| q | ","'") Strcontent = Replace (strcontent, "| QQ | ","""") Strcontent = Replace (strcontent, "| plus |", "+ ") Strcontent = Replace (strcontent, "| star | ","*") Strcontent = Replace (strcontent, "| minus | ","-") Strcontent = Replace (strcontent, "| equals |", "= ") Strcontent = Replace (strcontent, "| left |", "<") Strcontent = Replace (strcontent, "| right |", "> ") Strcontent = Replace (strcontent, "| percent |", "% ") Strcontent = Replace (strcontent, "| under | ","_") Strcontent = Replace (strcontent, "| backs | ","/") Strcontent = Replace (strcontent, "| fronts | ","/") SQL _decode = strcontent End if End Function |