The purpose of these query

  • Thread starter Frank Situmorang
  • Start date
F

Frank Situmorang

Hello,

Anyone canhelp me what is the purpose of this Query?, Is this just to list
all our tables and queries?

SELECT MsysObjects.Name AS [List Of Tables and Queries]
FROM MsysObjects
WHERE (((MsysObjects.Name) Not Like "~*" And (MsysObjects.Name) Not Like
"MSys*") AND ((MsysObjects.Type)=1 Or (MsysObjects.Type)=5))
ORDER BY MsysObjects.Name;


Thanks in advance
 
A

Allen Browne

Hi Frank

Access uses its own database engine to keep track of the objects in your
MDB, i.e. the tables, queries, forms, reports, etc. The names are stored in
a hidden system table named MSysObjects. You can see the table (but not
modify it) if you show hidden and system objects (Navigation Pane options in
A2007, or Tools | Options | View in previous versions.)

In MSysObjects, the Name field contains the name of the object, and the Type
field defines its type, e.g.:
1 = table
4 = ODBC linked table
6 = linked table
5 = query
-32758 = form
-32764 = report
- 32761 = module

Deleted objects (to be removed next compact), and hidden queries (for the
RecordSource of a form or the RowSource of a combo/listbox) start with "~".
The Microsoft system object names start with MSys.

Therefore, your query lists the names of the local tables and the queries in
the current database, excluding hidden and system objects, sorted by name.
 
F

Frank Situmorang

Thanks Allen your explanation is great.

--
H. Frank Situmorang


Allen Browne said:
Hi Frank

Access uses its own database engine to keep track of the objects in your
MDB, i.e. the tables, queries, forms, reports, etc. The names are stored in
a hidden system table named MSysObjects. You can see the table (but not
modify it) if you show hidden and system objects (Navigation Pane options in
A2007, or Tools | Options | View in previous versions.)

In MSysObjects, the Name field contains the name of the object, and the Type
field defines its type, e.g.:
1 = table
4 = ODBC linked table
6 = linked table
5 = query
-32758 = form
-32764 = report
- 32761 = module

Deleted objects (to be removed next compact), and hidden queries (for the
RecordSource of a form or the RowSource of a combo/listbox) start with "~".
The Microsoft system object names start with MSys.

Therefore, your query lists the names of the local tables and the queries in
the current database, excluding hidden and system objects, sorted by name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Frank Situmorang said:
Hello,

Anyone canhelp me what is the purpose of this Query?, Is this just to list
all our tables and queries?

SELECT MsysObjects.Name AS [List Of Tables and Queries]
FROM MsysObjects
WHERE (((MsysObjects.Name) Not Like "~*" And (MsysObjects.Name) Not Like
"MSys*") AND ((MsysObjects.Type)=1 Or (MsysObjects.Type)=5))
ORDER BY MsysObjects.Name;


Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top