"like "Querying an Access database for empty queries in a C # program

Source: Internet
Author: User
Tags access database

Today, in the process of development, a particularly strange problem has been found: access in the like query time. Run in an Access database and find the results can be queried. This is run on the database. SELECT * from kpproj where kpname like ' * Test * ', but the same statement is empty in a C # program. What's the situation?

This question is really a tangled one. With the experience of development, Access uses the * number in the like. But the SQL Server Oracle database to use the standard%, why not at this time? after searching for information. The last discovery is the connection to the access driver problem, used to be an MDB, the database is ACCDB. Then make the Win7 64-bit development system, because my program even access with the OLE DB driver, so here can not use "*", must use "%". If you are using DAO to access a database, you must use "*".

Discover that you are not experiencing access using *, so you have to determine it based on the actual driver;

"like "Querying an Access database for empty queries in a C # program

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.