none
What is table attribute 2? RRS feed

  • Question

  • I'm doing some obsessive documentation of an app I'm working on, which includes table attributes.  I have the list of the 6 attributes:

    dbSystemObject  -2147483646
    dbHiddenObject  1
    dbAttachExclusive  65536
    dbAttachSavePWD  131072
    dbAttachedODBC  536870912
    dbAttachedTable  1073741824

    The system tables, however, don't seem to match any of them.  For example:

    MSysRelationships  -2147483648
    MSysIMEXSpecs  2

    If I do: "-2147483648 And dbSystemObject" I get: "-2147483648".  OK, so it's a system object, sort of.
    But if I do: "2 And dbSystemObject" I get: "2".  Well, now I'm confused.

    They're obviously both system objects, but the numbers don't exactly match the constant values.  Are there some undocumented attributes?  Am I understanding the method for "reading" them correctly?

    Wednesday, January 3, 2018 9:26 PM

All replies

  • Hi victorcamp1,

    can you inform us how did you get the numeric value for Table.

    if you are using the code then please post your code.

    it will be better for us to reproduce the issue.

    you had mentioned that you are doing some documentation for an app.

    if you want to do Table Documentation then we generally use Database Documenter.

    Reference:

    Document and print your database design

    your approach for documentation is looks different then the normal approach.

    so let us inform us in detail and provide steps to reproduce the issue.

    we will try to provide you further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 4, 2018 2:04 AM
    Moderator
  • Hi victorcamp1,

    if you just want to find the table is system table or not then you can use code below.

    Option Compare Database   'Use database order for string comparisons.
    
    Option Explicit
    
    
    Function ShowTableAttribs()
       Dim DB As DAO.Database
       Dim T As DAO.TableDef
       Dim TType As String
       Dim TName As String
       Dim Attrib As String
       Dim I As Integer
    
       Set DB = CurrentDB()
    
       For I = 0 To DB.Tabledefs.Count - 1
          Set T = DB.Tabledefs(I)
          TName = T.Name
          Attrib = (T.Attributes And dbSystemObject)
          MsgBox TName & IIf(Attrib, ": System Table", ": Not System" & _
            "Table")
       Next I
    
    End Function

    Output:

    Reference:

    HOW TO: Use the Attributes Property for TableDef Objects in Microsoft Access

    further you can use query like below in Access directly.

    SELECT [Name] FROM [MSysObjects] WHERE [Type] = -32764 AND Left([Name],1) <> "~" ORDER BY [Name]  

    Reference:

    MS Access System Tables

    further , you can inform us your exact approach. we will test it and provide you a suggestion to solve the issue.

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, January 4, 2018 2:12 AM
    Moderator
  • You can get those values from the Immediate Window:

    ? CurrentDb.TableDefs("MSysRelationships").Attributes
    -2147483648
    ?
     CurrentDb.TableDefs("MSysIMEXSpecs").Attributes
    2

    It's just one of the TableDef properties.  I think my code would just confuse the issue.  I loop through each table in the database and collect lots and lots of various properties.  If you press F1 when the cursor is on the word 'Attributes', the Help file will show a list of valid values, with their constants.  Well, it may only show the constant and a description, but you can just ask Access what the value is.

    Thursday, January 4, 2018 2:15 AM
  • It's not a problem, really.  I'm just trying to understand why the values don't seem to coincide with the documentation.  With Attributes (field, table, relation), I may parse them out for a report. So a table listing would have the 6 attributes in 6 columns, with an 'X' in the column or columns indicating which ones that table has.  Within code, it could be something like:

    If .Attributes And dbSystemObject <> 0 Then
        blnRetVal = True
    Else
        blnRetVal = False
    End If

    Each of the columns would call their own little function to show which of the constants are satisfied by the table's Attributes.


    • Edited by victorcamp1 Thursday, January 4, 2018 2:36 AM typo
    Thursday, January 4, 2018 2:35 AM
  • To get a quick idea of how it works, you can do it all in the Immediate Window, like this:

    ? CurrentDb.TableDefs("MSysRelationships").Attributes And dbSystemObject
     -2147483648

    ? CurrentDb.TableDefs("MSysRelationships").Attributes And dbHiddenObject
     0

    ? CurrentDb.TableDefs("MSysRelationships").Attributes And dbAttachExclusive
     0

    ? CurrentDb.TableDefs("MSysRelationships").Attributes And dbAttachSavePWD
     0

    ? CurrentDb.TableDefs("MSysRelationships").Attributes And dbAttachedODBC
     0

    ? CurrentDb.TableDefs("MSysRelationships").Attributes And dbAttachedTable
     0

    So the table only meets the dbSystemObject criteria.  Do it on a linked table, and you'll get different results.




    Thursday, January 4, 2018 2:45 AM
  • That is indeed obsessive - too obsessive and unnecessary. If I was the next developer I would want to understand what are the requirements for the application, and what trade-offs have been made, how the startup code works, and how the app is deployed. I don't need to be told that the Employee table has a required LastName field of 30 chars.

    Also note that the values are bitwise and can be added. You probably want to look at the values in Hex.

    I have found several attributes values by trial and error when I was working on a Linked Table Manager; the value 2 never occurred, although dbSystemObject is 8000 0002 hex.


    -Tom. Microsoft Access MVP

    Thursday, January 4, 2018 2:23 PM
  • It is, indeed, too obsessive! Nevertheless, now my OCD wants to solve the riddle.  And I think you nailed it by referring to the hex.  This thread may become more about math than attributes, since I don't really understand how those "And" equations work.

    In several other properties where adding several constants together gives you the property value, they're often set up with values like 1, 2, 4, 8, 16, 32, etc.  One can often glance at the total and figure out which ones fit and which don't.  I'm used to doing the calculation and getting either 0 -- it's not there -- or it returns the constant value -- it is there.  With those table constants, however, the dbSystemObject returns -2147483648, whereas the constant is -2147483646, a different value.  And that the "2" is also matched by the dbSystemObject blows my mind.

    I get the feeling that if I understood what's going on, those 2 matches would make perfect sense.  So, how does that work?

    Thursday, January 4, 2018 2:47 PM
  • I get the feeling that if I understood what's going on, those 2 matches would make perfect sense.  So, how does that work?

    Hi victorcamp1,

    The attribute is stored in a long type (4 bytes). An long type value is a signed value, ranging from -2147483648 to 2147483647. The most significant bit is the sign bit. That bit set means negative figures, cleared means zero or positive numbers.

    A value of -2147483646 means:  all bits cleared except the sign bit (-214783648)  + 2,

    or in bits:    1000 0000 0000 0010

    Imb.

    Thursday, January 4, 2018 4:58 PM
  • > I don't really understand how those "And" equations work.

    LOL, I know too well about OCD. In this case "And" is the wrong bitwise operator, it is "Or". Go figure. Or better: Use your programmer calculator. It really makes sense once you let it sink in. Study the bitwise truth tables.


    -Tom. Microsoft Access MVP

    Friday, January 5, 2018 4:10 AM
  • I'll have to take a look at those, and try the 'Or', but right now it's way to late, and I've been at the computer for 13 hours.  I'll figure it out over the weekend, and then probably finish the thread.

    Saturday, January 6, 2018 3:11 AM
  • Hi victorcamp1,

    I suggest you to update the status of the thread once you make a test.

    if you think that suggestion given by the community member can solve the issue then I suggest you to marl their suggestions as an answer.

    it will help us to close this thread and it will help other community members in future who will have same kind of issue like yours.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 8, 2018 8:19 AM
    Moderator