public Function RSQL(strChar)
. t+ R, k! Q# p7 [% [& R4 d( ~ If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function
! ?6 L. i3 A, B! z3 O$ T Dim strBadChar, arrBadChar, tempChar, I
2 j) D( U# E$ d+ m strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
0 `5 P; w2 a3 Q* @$ k, P5 K arrBadChar = Split(strBadChar, ",")
5 N; {+ S* Q6 a4 m9 f* u( F tempChar = strChar$ k* P3 e+ {3 P
For I = 0 To UBound(arrBadChar)
( T" [2 t! [' _7 Z6 B tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空: V8 E2 j) o0 P8 p1 H
Next; \) M. A& J5 V2 i6 t
RSQL = tempChar
* Y' G& x% _1 z) XEnd Function7 G8 y! J- I+ k" |: @( n
|