非法字符可以进行Replace过滤
比如如下函数替换非法字符
Str参数就是原始字符串可能含有非法字符的字符串
返回值是过滤后的字符串,非法字符都被过滤为***
Function ReplaceIllegalStr(Str)
Dim IlStr,IlAry,i
IlStr="非法字符1|非法字符2|非法字符3|非法字符4|非法字符5|非法字符6"
IlAry=Split(IlStr,"|")
For i=0 To UBound(IlAry)
Str=Replace(Str,IlAry(i),"***")
Next
ReplaceIllegalStr=Str
End Function