Function pop_sqlin (text)
If isnull (text) then
Pop_sqlin = ""
Exit Function
End if
Dim sqlwords
Set sqlwords = new Regexp
Sqlwords. ignorecase = true
Sqlwords. Global = true
Sqlwords. pattern = "(')"
TEXT = sqlwords. Replace (text ,"''")
Sqlwords. pattern = "(;)"
TEXT = sqlwords. Replace (text ,";")
Sqlwords. pattern = "(% )"
TEXT = sqlwords. Replace (text, "% ")
Sqlwords. pattern = "(and )"
TEXT = sqlwords. Replace (text, "and ")
Sqlwords. pattern = "(EXEC )"
TEXT = sqlwords. Replace (text, "EXEC ")
Sqlwords. pattern = "(execute )"
TEXT = sqlwords. Replace (text, "execute ")
Sqlwords. pattern = "(insert )"
TEXT = sqlwords. Replace (text, "insert ")
Sqlwords. pattern = "(select )"
TEXT = sqlwords. Replace (text, "select ")
Sqlwords. pattern = "(delete )"
TEXT = sqlwords. Replace (text, "delete ")
Sqlwords. pattern = "(update )"
TEXT = sqlwords. Replace (text, "Update ")
Sqlwords. pattern = "(count )"
TEXT = sqlwords. Replace (text, "Count ")
Sqlwords. pattern = "(CHR )"
TEXT = sqlwords. Replace (text, "CHR ")
Sqlwords. pattern = "(MID )"
TEXT = sqlwords. Replace (text, "mid ")
Sqlwords. pattern = "(master )"
TEXT = sqlwords. Replace (text, "Master ")
Sqlwords. pattern = "(truncate )"
TEXT = sqlwords. Replace (text, "truncate ")
Sqlwords. pattern = "(char )"
TEXT = sqlwords. Replace (text, "char ")
Sqlwords. pattern = "(declare )"
TEXT = sqlwords. Replace (text, "declare ")
Set sqlwords = nothing
Pop_sqlin = text
End Function
Function pop_sqlout (text)
If isnull (text) then
Pop_sqlout = ""
Exit Function
End if
TEXT = Replace (text ,"''","'")
TEXT = Replace (text ,";",";")
TEXT = Replace (text, "%", "% ")
TEXT = Replace (text, "and", "and ")
TEXT = Replace (text, "EXEC", "EXEC ")
TEXT = Replace (text, "execute", "execute ")
TEXT = Replace (text, "insert", "insert ")
TEXT = Replace (text, "select", "select ")
TEXT = Replace (text, "delete", "delete ")
TEXT = Replace (text, "Update", "Update ")
TEXT = Replace (text, "Count", "Count ")
TEXT = Replace (text, "CHR", "CHR ")
TEXT = Replace (text, "mid", "mid ")
TEXT = Replace (text, "Master", "Master ")
TEXT = Replace (text, "truncate", "truncate ")
TEXT = Replace (text, "char", "char ")
TEXT = Replace (text, "declare", "declare ")
Pop_sqlout = text
End Function
Function htmlencode (popstring)
If not isnull (popstring) then
Popstring = pop_sqlout (popstring)
Popstring = Replace (popstring, ">", "> ")
Popstring = Replace (popstring, "<", "<")
Popstring = Replace (popstring, CHR (32 ),"")
Popstring = Replace (popstring, CHR (9 ),"")
Popstring = Replace (popstring, CHR (34 ),""")
Popstring = Replace (popstring, CHR (39 ),"'")
Popstring = Replace (popstring, CHR (10) & CHR (10), "</P> <p> ")
Popstring = Replace (popstring, CHR (10), "<br/> ")
Popstring = Replace (popstring, CHR (36), "$ ")
Htmlencode = popstring
End if
End Function