In the morning, when I was writing a project, I found that I had read the row set known as like a string from the access document table. How can I get it? The number of rows in the set read is 0.
I started to study the like syntax. On msdn, we can see that sqlserver uses the % wildcard and the * wildcard in access.CodeIf you use like '* XXX *', the return value is 0!
Then, place the SQL statement in the access query and you will find that two rows can be read!
Depressed!
However, the project cannot be tracked for debugging.
After a long morning of hard work, I checked it on Baidu and found a result:
Bytes ---------------------------------------------------------------------------------------------
AccessLiLikeThe wildcard usage of is as follows:
"?" Represents any single character; "*" Represents zero or multiple characters; "#" represents any number
So it should be:
Select * From databasename where fieldnameLike'* XX *'
Originally, % was used in SQL Server.AccessThe ** number is used. No wonder no data can be found!
However, if you want to use % again in tableadapter of vs2005, you cannot use !!!
Bytes --------------------------------------------------------------------------------------------------
In the last sentence, I used vs2005 and replaced * With % in the SQL statement.
Depressing! One morning!