public Function RSQL(strChar)
, H5 S- ]. Z3 S% L) U If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function% ?- |2 m7 T; }/ _
Dim strBadChar, arrBadChar, tempChar, I
3 R" g4 ?& {! j) b! V strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
6 `# y+ m+ B; o) m5 B arrBadChar = Split(strBadChar, ",")
# D; U2 a5 Z: b1 n tempChar = strChar' {- @; ^, I# [
For I = 0 To UBound(arrBadChar)3 e7 q& T# B$ H" [, d
tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空( V9 \4 o* n: U. L3 U: @1 n
Next6 a) S, U s: [
RSQL = tempChar4 V M- u- y# D/ u: n% o |% I+ D3 A
End Function
p' H. G2 \: C3 Z$ j7 N2 f |