Function SQL_encode(strContent) If isnull(strContent) = False Then strContent = replace(strContent, """", """) strContent = replace(strContent, "'", "'") strContent = replace(strContent, "+", "+") strContent = replace(strContent, "*", "*") strContent = replace(strContent, "-", "-") strContent = replace(strContent, "=", "=") strContent = replace(strContent, "<", "<") strContent = replace(strContent, ">", ">") strContent = replace(strContent, "%", "%") strContent = replace(strContent, "_", "_") SQL_encode = strContent End If End Function Function SQL_decode(strContent) If isnull(strContent) = False Then strContent = replace(strContent, """, """") strContent = replace(strContent, "'", "'") strContent = replace(strContent, "+", "+") strContent = replace(strContent, "*", "*") strContent = replace(strContent, "-", "-") strContent = replace(strContent, "=", "=") strContent = replace(strContent, "<", "<") strContent = replace(strContent, ">", ">") strContent = replace(strContent, "%", "%") strContent = replace(strContent, "_", "_") 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 |