public Function RSQL(strChar)( V7 Z9 }5 N* ]7 B! O2 t8 s
If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function
' W3 U8 c3 c" W/ A. [* q Dim strBadChar, arrBadChar, tempChar, I
8 Q5 m% n. F& _2 l7 a4 p1 D# H strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
5 R6 K6 b: v) P arrBadChar = Split(strBadChar, ",")
8 U. K+ } {- F: q1 [* z3 v tempChar = strChar0 l$ q2 d+ t* H8 m# n
For I = 0 To UBound(arrBadChar)
3 q3 i" @$ w; w3 A tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空7 w; p8 }2 ?3 ?' ~7 @
Next
2 K+ O5 q0 Y. K+ d% v! o RSQL = tempChar
6 t6 L7 B6 R2 c+ |0 p# yEnd Function
" i& R6 n7 l, ?/ Q: T |