Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. name & count of tables in a MS Access database

name & count of tables in a MS Access database

Scheduled Pinned Locked Moved C#
databasehelptutorialquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    phowarso
    wrote on last edited by
    #1

    Could u tell me how to get name and count of tables in a MS Access database? I tried by MSysObjects but i have an error. Error says that to use administrator account. But i have used just an administrator account one. Could u tell me any other ways for that matter.

    K L P D 4 Replies Last reply
    0
    • P phowarso

      Could u tell me how to get name and count of tables in a MS Access database? I tried by MSysObjects but i have an error. Error says that to use administrator account. But i have used just an administrator account one. Could u tell me any other ways for that matter.

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      PiebaldConsultant gave you and Answer yesterday[^]. If you want more help you will need to be more specific: 1) Did you try his suggestion it should work- if not what went wrong 2) How are you accessing MSysObjects (supply code)? Point 2 is most important as there are several scenarios: A: You are accessing the table directly in which case you need to be an admin on the database B: You are accessing via an application If this is using windows authentication to the database: The account the app is running under needs to be an admin on the database. For a winforms app, it would be running under your account. Web apps are more complicated and you'll need to work out which account is being used. If this is using an "SQL account" (i.e. you have supplied a username and password)to the database: The account specified needs to be an admin on the database

      Sort of a cross between Lawrence of Arabia and Dilbert.[^]
      -Or-
      A Dead ringer for Kate Winslett[^]

      1 Reply Last reply
      0
      • P phowarso

        Could u tell me how to get name and count of tables in a MS Access database? I tried by MSysObjects but i have an error. Error says that to use administrator account. But i have used just an administrator account one. Could u tell me any other ways for that matter.

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        There is "SYS" in MSysObjects, no wonder you need a special account when going that route. Stick with OleDbConnection.GetSchema() as Piebald told you. :)

        Luc Pattyn [My Articles] Nil Volentibus Arduum


        Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.

        1 Reply Last reply
        0
        • P phowarso

          Could u tell me how to get name and count of tables in a MS Access database? I tried by MSysObjects but i have an error. Error says that to use administrator account. But i have used just an administrator account one. Could u tell me any other ways for that matter.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          I strongly recommend avoiding database-specific techniques. ADO.net includes interfaces and base classes that make database-agnostic access very easy to accomplish.

          1 Reply Last reply
          0
          • P phowarso

            Could u tell me how to get name and count of tables in a MS Access database? I tried by MSysObjects but i have an error. Error says that to use administrator account. But i have used just an administrator account one. Could u tell me any other ways for that matter.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            phowarso wrote:

            Error says that to use administrator account.
            But i have used just an administrator account one.

            That's not refering to an admin account on the machine. That's refering to the designated administrator account in the database. The two are not the same thing. Seriously, follow the advice given yesterday. You're trying to do it the hard way.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups