public Function RSQL(strChar)
. o' ]9 K( f! Y, f5 `' M$ U% V' ? If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function( X0 B! S' J& ~% ^+ W0 T
Dim strBadChar, arrBadChar, tempChar, I
Y/ c$ \8 H) P strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
) u- ~8 |+ f8 z# } arrBadChar = Split(strBadChar, ",")* V" {8 Q/ ~: H6 V& e7 w- P
tempChar = strChar" m! r/ D% R* D' f! M- S! k
For I = 0 To UBound(arrBadChar)8 |; J: v9 d( {, g# F* a/ Q
tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空
! Z$ F4 j* ]3 E Next
* a2 T! g% T! N RSQL = tempChar
4 W3 O0 `- x7 w+ b8 s7 qEnd Function8 P) ]3 J5 G' C3 Y
|