Depressed, depressed, for access like, tossing for a morning.

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.