Since the wildcard character in the fuzzy query statement like in Access is not % but *, it should be noted that when we write fuzzy queries in programs, we usually write them as follows:
Select * from table where txtTitle like '%Script Home%'
Regardless of whether the connected database is ACCESS or SQL Server
However, when writing programs recently, there are always situations where the statements are correct, but the results cannot be obtained. For example: manually setting server security simply, and the thoughts it caused. Here is the situation where I always cannot get the results when writing service queries. Time Over time, this problem occurred more often. I found a problem. If I write it into the program according to the above method, it will be correct, but If you use the query function in ACCESS, you will find that the same code cannot run. Why? Why is it normal when called in the program? Search on the Internet, OK. It seems that if you have problems these days, you should go to Google or Baidu. , it turns out that the query in ACCESS does not support fuzzy queries like this '%Liu Yongfa%', the equivalent of % is the wildcard character: *, so it needs to be changed to
Select * from table where txtTitle like '*Script Home*'
The query analyzer of SQL Server still supports the writing of normal SQL statements. I wonder why ACCESS is so nimble.
Also, I often use the query function of ACCESS to operate directly in the database. Why didn't I find this problem after using it for so long? Is it because when the problem is discovered, the program can be used and it is ignored, or is it not discovered at all? I think I have discovered that maybe the project was too tight, so I didn't study him.