Meaning of MsysObjects values -32758, -32757 and 3 (Microsoft Access)

前端 未结 5 1667
忘了有多久
忘了有多久 2020-12-05 21:16

I\'m quering the table MsysObjects for making a list of the objects in my database:

SELECT MsysObjects.Name, MsysObjects.Type
FROM MsysObjects
WHERE (((Left$         


        
5条回答
  •  悲哀的现实
    2020-12-05 21:53

    FWIW - IIF is a drag, and the switch solution doesn't seem valid for SQL (I may have done something wrong). I entered the values that Fionnuala offered into a new table named AccessObjectXref:

    ID  ObjectType  ObjectDesc
    1   -32768  Form
    2   -32766  Macro
    3   -32764  Report
    4   -32761  Module
    5   -32758  Users
    6   -32757  DB Document
    7   1   Table
    8   2   DB
    9   3   Container
    10  5   Query
    11  8   Subdatasheet
    

    Then used the following SQL to create a list of object names and their counts. Obviously you could include every record if you wanted:

    SELECT objectdesc, Count(*) AS Expr1
    FROM msysobjects,  AccessObjectTypeXref where type = objecttype
    group by objectdesc order by objectdesc
    

提交回复
热议问题