Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    4

    Red face Unanswered: Querying MsysObjects table

    Hi All,

    I want to Query MsysObjects table programmatically in vc++ to get the name and number of tables in an ms access database.MsysObjects table contain all the info about tables, queries,reports in access database.when i try to query MsysObjects table "Access is denied". How can i query MsysObjects table or in other words how can i get the access to Msystable?


    // Build the SQL statement
    SqlString = "SELECT Name FROM MsysObjects where type = 1 AND (Left([Name],4) <> \"Msys\") AND (Left([Name],1) <> \"~\")";
    // Execute the query
    recset.Open(CRecordset::forwardOnly,SqlString,CRec ordset::readOnly);

    Please Help!
    Regards,
    Ankush Mehta

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try to copy its contents to another table for example MsysObjeKts, then try to query this table.

  3. #3
    Join Date
    Nov 2005
    Posts
    4

    Red face

    Hi

    i have to do it programmatically. so simply i just can't do that unless access is granted.however, i have found the solution but i am not able to implement it. i can get the access to MsysObjects table in the following way:
    1) Open the database
    2) Go to tools-->Options
    3) Check the box under show that says system Objects. You will notice that several new tables appear in table view with the prefix MSys - MSysAccessObjects, MSysAces, MSysObjects, MSysQueries, MSysRelationships, and there may be a few others depending on your version of Access.
    4) Now Go to Tools-->Security-->User and Group Permissions
    5) Select the MSysObjects table and check the box that says "Read Data"

    However, i don't know why User and Group Permissions is not enabled
    in menu options of my ms access.Can anyone tell me how to get it enabled.

    Please Help!!

    Regards,
    Ankush Mehta

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

    Lightbulb

    What I meant is, do a create Table Query such that

    SELECT MSysObjects.* INTO ObjeKts
    FROM MSysObjects;

    then do your queries to to the table ObjeKts.

Posting Permissions

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