Author: Gu Jian
Ah, I haven't written anything for a long time. This time, the teacher asked me to test my own things again and found that the filtering of special characters is lax, therefore, a function is rewritten to filter out special characters.
Function chkinvaildword (words)
Const invaildwords = "select | update | Delete | insert | @ | -- |," 'must be separated by "|". The final character must be |
Chkinvaildword = true
Invaildword = Split (invaildwords, "| ")
Inwords = lcase (TRIM (words ))
For I = lbound (invaildword) to ubound (invaildword)
If instr (inwords, invaildword (I)> 0 then
Chkinvaildword = true
Exit Function
End if
Next
Chkinvaildword = false
End Function
It is relatively simple and you will not be able to use it.
However, I was prepared to use for each... next at the beginning, but I don't know why it is wrong. So I switched to the for loop instead, and I felt uncomfortable, but I can use it!
(PS: Today, I have a headache for a whole day. I don't know when the damn headache will be good. Otherwise, I will be ruined by tomorrow's work! We look forward to a good situation tomorrow !)