public Function RSQL(strChar)7 a& I N/ E! `" O' p! w
If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function
0 p1 k0 L! C) L" c! J# Y9 X4 ] Dim strBadChar, arrBadChar, tempChar, I8 L* Y, @! ^% c! P/ b) T
strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00* X+ Y. V) b x$ }# v% I9 [4 s. V! H
arrBadChar = Split(strBadChar, ",")
) |# P0 M# w; k, ^6 Y7 k) p/ s tempChar = strChar
- b# C. i% [& P. `) g3 p* z1 n For I = 0 To UBound(arrBadChar)
8 k5 Z- V, O# Z8 f* K4 V. k/ h tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空
; ]( |' X% F5 ^+ H: V Next
+ E: B! D: l) W0 x* o3 p RSQL = tempChar/ O/ Y' u* ]. ?7 Y# E3 Q7 |! K
End Function ~3 R! s! u1 w: e# N
|