public Function RSQL(strChar)
& ?& L6 }- A& y* h9 |9 _/ ]" w1 R6 @ If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function
) P' u2 j( d' }5 G Dim strBadChar, arrBadChar, tempChar, I
: U$ o6 U8 Z; @& l3 {9 S5 l strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00 q4 f7 b1 A) P$ m% x7 L4 Z) U
arrBadChar = Split(strBadChar, ",")
1 G6 G {, E0 A4 ~) I9 ]+ l tempChar = strChar
9 `: h! T% i- h: g For I = 0 To UBound(arrBadChar)
5 L$ m% E8 C* F9 r& j+ Z1 A tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空2 ^0 U7 K2 p8 u" H" z7 F* v0 \' S
Next0 a# v( J2 i7 u+ `
RSQL = tempChar* l% w j4 T: K$ c
End Function
9 m8 F* j' t6 V' \ |