An issue where a C # program uses "like" to query for an Access database query that is empty

Source: Internet
Author: User

Today, a particularly strange problem has been found in the development process: When a like query in Access is executed in an Access database, it is found that the results can be queried, which is performed on the database, select * from kpproj where kpname like ' * Test * ', but the same statement is empty in a C # program, what is the case?

This is a very complicated question, through the previous development experience, access in the like need to use the * number, but SQL Server Oracle database to use the standard%, why not at this time? after searching for data, the last discovery is connected to the access driver problem, used to be MDB, the database is ACCDB, and then make Win7 64-bit development system, because my program even uses OLE DB drivers for access, you cannot use "*" in this case and you must use "%". If you are using DAO to access the Access database, you must use "*".

The discovery is not to encounter access to use *, so according to the actual driver to determine;

C # programs use "like" to query an Access database for empty queries

Related Article

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.