Tips for using SQL statements to find out if a table exists in Access _access

Source: Internet
Author: User
Tags access database

The Access database, though a single feature, is indeed a small, lean development partner, and I met it in several projects to find out the source of the Access database, and today I went online for some information. The summary is summarized as follows:

It is really difficult to find a table in an Access database with an SQL statement. Fortunately, access itself has some hidden data objects can save your library information, today I encountered to use SQL, through the program to query whether a table exists problems, the solution is as follows:
Because the Administrators group of the Access database itself does not have permission to access suppressed objects, you first: Tools-> options-> view-> hidden objects, system objects, and previous tick selections.

The tool then-> Security-> User and group permissions, selects msysobjects in the object name (I only use this object, if I need something else, I can select it), and then set the Read Data permission in the permissions.

Finally, save the settings, in the program, you can query the table through the SQL statement, the statement is as follows:

SELECT Count (*) as Rtab from Msysobjects WHERE ((msysobjects.name) like "known table name to be judged");

Return 1 is present, 0 is not present
System environment: Win2000 Access2000

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.