Results 1 to 9 of 9

Thread: Attributes

  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Unanswered: Attributes

    If I have the TableOfDef (tdf) Object and I want to show the only System Files the I use
    PHP Code:
      if tdf.Attributes And dbSystemObject then
         command to show the system files
       end 
    if 
    That runs fine


    When I want to show the non-System files I used
    PHP Code:
      if NOT (tdf.Attributes And dbSystemObjectthen
          command to show the NON
    system files
      end 
    if

      if  
    Not tdf.Attributes And NOT dbSystemObject then
          command to show the NON
    system files
      end 
    if 
    But it doesn't show the non-sysstem files it shows both

    I tried more but in vain
    Can any one help? Thanks

  2. #2
    Join Date
    Jan 2004
    Location
    Islamabad, Pakistan
    Posts
    97
    Try using
    if Left(tdf.Name, 4) <> "MSys" then
    command to show the non system files
    end if


    - Saqib

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thanks for your reply,
    I know this solution but this is not suitable one, suppose some own tables starting with MSys and they are not systemtables.

  4. #4
    Join Date
    Jan 2004
    Location
    Islamabad, Pakistan
    Posts
    97
    Then try

    If (tdf.Attributes And Not dbSystemObject) Then
    command to display the non system files
    End If

  5. #5
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    how about using

    If tdf.Attributes = 0 Then

    this returns the "normal" tables i.e. the non system files

    True on tdf.Attributes shows system tables
    False on tdf.Attributes shows all tables
    True and false of the dbSystemObject returns the complete set

    so the only way i can see of doing it via logic would probably be an inverse intersect
    i.e. In dbSystem Object And Not In tdf.Attributes

    id stick with tdf.attributes = 0

    Dave

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thank you DAve, it functions with your suggestion.
    The suggestion of Sagib doesn't

    Thank you both

  7. #7
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Dave,
    sorry to say it doesn't function for tabels that are linked through ODBC!

  8. #8
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Ok we will get there soon
    how about this

    If (tdf.Attributes = 0 Or (tdf.Attributes And (dbAttachedODBC Or dbAttachedTable))) Then

    the reference i used was ACC: How to Use the Attributes Property for TableDef Objects

    Dave

  9. #9
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Now it is perfect, it functions
    Thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •