To return the name of an Access database object through a query

Source: Internet
Author: User
Tags access database

Summary: How to use a query to get the name of a database object (Query/form/table/Report/module/macro)

Body:

(q): How do I use a query to get the name of a database object (Query/form/table/Report/module/macro)?

(a): Access system table Msysobjects contains a list of database objects, though not documented in the document, you can still query it to get what you want.

Note: Do not intentionally or unintentionally modify any access system tables, otherwise unexpected situations may occur.

Use the following SQL statement to get what you want

Inquire:

SELECT msysobjects.name from Msysobjects WHERE (left$ ([name],1) <> "~") and (Msysobjects.type) =5 the ORDER by Msysobjects.name;

Forms: SELECT msysobjects.name from Msysobjects WHERE (left$ ([name],1) <> "~") and (Msysobjects.type) =-32768 the ORDER by MS Ysobjects.name;

Table: SELECT msysobjects.name from Msysobjects WHERE (left$ ([name],1) <> "~") and (left$ ([name],4) <> "Msys") and ( Msysobjects.type) =1 order by Msysobjects.name;

Report:

SELECT msysobjects.name from Msysobjects WHERE (left$ ([name],1) <> "~") and (Msysobjects.type) = -32764 ORDER by Msyso Bjects. Name;

Module: SELECT msysobjects.name from Msysobjects WHERE (left$ ([name],1) <> "~") and (Msysobjects.type) = -32761 ORDER by MS Ysobjects.name;

Macros: SELECT msysobjects.name from Msysobjects WHERE (left$ ([name],1) <> "~") and (Msysobjects.type) = -32766 ORDER by MSy Sobjects.name;

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.