public Function RSQL(strChar)
! x9 i/ X) `6 e% v If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function& |: Y5 N( M/ G7 e! P
Dim strBadChar, arrBadChar, tempChar, I1 P" A; v9 o* v
strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
& Z9 W8 O6 |5 n. _0 P5 ?6 @/ x arrBadChar = Split(strBadChar, ",")
+ C7 s T U( `8 S: B& x8 A" S tempChar = strChar
5 E5 M" x: l9 w. l3 t+ r4 G, F For I = 0 To UBound(arrBadChar)7 @8 ~" |# L0 u$ E9 a7 r, f
tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空3 U0 r5 d# A! q. o1 |6 b/ D* Z
Next9 N7 B4 H# ?3 K% @* R) t
RSQL = tempChar
2 w" ?# `# Y0 W8 Z: b0 e8 d% dEnd Function
+ n8 h/ \% F2 ^1 K |