public Function RSQL(strChar)
( f5 w3 e# ]. V# V If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function
( p+ b4 e/ M! `' j Dim strBadChar, arrBadChar, tempChar, I \$ g. y, W* f" @
strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
9 q4 W+ t, q, B \ r8 J9 e arrBadChar = Split(strBadChar, ","): Y5 M9 H6 V4 ~: f) E& v' n) |
tempChar = strChar, @ S7 o' g* ^" w. r) u+ f
For I = 0 To UBound(arrBadChar)/ [( n: ~3 b; D, g) K% a
tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空% m1 a, _. S5 F3 [% q! z$ t
Next0 M: A- ~% ?0 d% G% z" U
RSQL = tempChar
' t5 B2 c0 D. f" k* j6 \( O* S1 DEnd Function! {' ]! F- i, \4 T
|