public Function RSQL(strChar)
3 D+ n$ i2 `$ C+ Y' [+ b2 K# E3 k If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function( T( T) _! a% l2 k, _; k! J
Dim strBadChar, arrBadChar, tempChar, I
6 G3 e% s0 d; F strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的007 m. W# i: R9 Z, L2 C
arrBadChar = Split(strBadChar, ",")
9 Z& L; m. c( m5 Z tempChar = strChar2 y3 v+ K! ~$ i
For I = 0 To UBound(arrBadChar)
3 E/ C& \ q7 i; ?' ? tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空
F. ^" G9 ~* q6 z, m6 U Next
4 F- z/ ` g, ?( t, N- \! B RSQL = tempChar+ S3 W1 v& a$ r
End Function. `, y) G+ A, ^2 l
|