Today in the daily maintenance of a website, found that the site's message program did not undergo a rigorous validation of filtering, resulting in nearly 100,000 garbage data. And there is important information to clean up the data and to add more stringent verification measures.
and by deleting it directly in the database is not very scientific, will mistakenly delete a lot of important information.
Through the Fuzzy query statement:
Copy Code code as follows:
SELECT * from Feedback where Comments like '%http% '
Result: "Memory Overflow"
After a continuous search, identified the main reasons for the problem:
ASP in the use of the LIKE keyword query Japanese symbols will be an error, such as Chr (-23075), prompted memory overflow.
A memory overflow error can also occur if the data in the datasheet contains Japanese or some special non-simplified kanji symbols.
The internet said that the above issues have been Microsoft Power Camp Microsoft engineers confirmed that the product for the BUG, can not be resolved. The only way to do this is to encode the data in the entire database into ANSI text format and save it. When the show is decode.
No solution, only the above mentioned, the field transformation to save to another new field, and then the cleanup operation. It's hard to deal with this standard data.
encodestring function for character escape
Copy Code code as follows:
Function encodestring (strwords)
Dim I as Long
Dim Strencodewords
For i = 1 to Len (strwords)
Strencodewords = strencodewords & CStr (ASC (Mid (Strwords, I, 1)) & ","
Next
encodestring = Strencodewords
End Function
After escaping, the keyword is escaped in a blur search.
Copy Code code as follows:
Delete * from Feedback where comments_new like '%&encodestring ("http") &% '