Record(s) cannot be read; no read permission on 'MSysObjects'.

Rate It (2)

Last post 08-08-2007 11:59 AM by moizdhanji. 7 replies.

Sort Posts:

  • Record(s) cannot be read; no read permission on 'MSysObjects'.

    03-27-2006, 11:45 AM
    • Loading...
    • mariolopes
    • Joined on 04-15-2005, 2:42 PM
    • Coimbra - Portugal
    • Posts 470

    I want to populate a combobox with the name of the tables of one access database. I use the following statment

    SELECT [Name] FROM MSysObjects WHERE [Type] = 1

    I get stuck on the error Record(s) cannot be read; no read permission on 'MSysObjects'.

    Any help?

    Thank you

     

    Mario Lopes
  • Re: Record(s) cannot be read; no read permission on 'MSysObjects'.

    03-27-2006, 1:59 PM
    • Loading...
    • deokule2003
    • Joined on 12-05-2005, 6:09 PM
    • Pune, India
    • Posts 356
    Hello,

    According to me 'MSysObjects' is hidden table created it-self  by Access database. Users might not have permission to read this table.

    Can't you use different table name?

    Regards

    Kuldeep Deokule
    MCSD.NET
    Blog: http://dkuldeep.blogspot.com

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Record(s) cannot be read; no read permission on 'MSysObjects'.

    03-28-2006, 5:13 AM
    • Loading...
    • mariolopes
    • Joined on 04-15-2005, 2:42 PM
    • Coimbra - Portugal
    • Posts 470

    Hello

    My access database name's english

    How can write the sql statment for extract the name of all tables in that database?

    Thank you  

    Mario Lopes
  • Re: Record(s) cannot be read; no read permission on 'MSysObjects'.

    03-28-2006, 8:03 AM
    • Loading...
    • deokule2003
    • Joined on 12-05-2005, 6:09 PM
    • Pune, India
    • Posts 356
    Hello,

    To get a list of table names use following code.

            Dim sConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\english.mdb"
            Dim olecon As New OleDbConnection(sConn)
            olecon.Open()
            Dim dt As DataTable = olecon.GetSchema("tables")
            olecon.Close()
            GridView1.DataSource = dt
            GridView1.DataBind()

    I gridview you'll get list of tables.
    I suggest don't use Msysobject. It creates problem related to access. ADOX and Msysobjects works fine with windows applications but may problematic for web apps.

    Regards

    Kuldeep Deokule
    MCSD.NET
    Blog: http://dkuldeep.blogspot.com

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Record(s) cannot be read; no read permission on 'MSysObjects'.

    03-28-2006, 10:39 AM
    • Loading...
    • mariolopes
    • Joined on 04-15-2005, 2:42 PM
    • Coimbra - Portugal
    • Posts 470

    Works great

    One more question: if i want to show all the tables except the system tables (TABLE_TYPE only Table). Any ideas?

    It is possible to do it with a sql statment?

    Thank you a lot...

    Mario Lopes
  • Re: Record(s) cannot be read; no read permission on 'MSysObjects'.

    03-29-2006, 2:06 PM
    • Loading...
    • deokule2003
    • Joined on 12-05-2005, 6:09 PM
    • Pune, India
    • Posts 356
    Hello,

    Ok..

    Actually hint is in your last post itself (TABLE_TYPE only Table).

    Here is a code, just change two lines in earlier code:

            Dim tblrestrictions As String() = New String() {Nothing, Nothing, Nothing, "TABLE"}
            Dim dt As DataTable = olecon.GetSchema("tables", tblrestrictions)

    Note:
    Restrictions are a string array in the following format:
    {TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE}.

    Regards

    Kuldeep Deokule
    MCSD.NET
    Blog: http://dkuldeep.blogspot.com

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Record(s) cannot be read; no read permission on 'MSysObjects'.

    08-02-2007, 10:40 PM
    • Loading...
    • kenbati
    • Joined on 01-29-2007, 7:54 PM
    • Posts 264

    Very good Kuldeep;  On quick question.  On the same lines how do one see Field names and their types? thanks in Advance

    Without your help I can do nothing. When I help you and you can do something then do not forget to mark it as answer!!
    Filed under:
  • Re: Record(s) cannot be read; no read permission on 'MSysObjects'.

    08-08-2007, 11:59 AM
    • Loading...
    • moizdhanji
    • Joined on 08-08-2007, 11:48 AM
    • Posts 1
    If you people are using AccessDataSource and having error "Record(s) cannot be read; no read permission on [table]", first step is to open up the MDB file and assign full rights to Admin user for each & every table either its system or hidden table.
    if you want to see all system & hidden tables, go to Tools -> Options -> View Tab and enable all check boxes.
    if you want to assign security to Admin (or any) user, go to Tools -> Security -> User and Group Permissions and assign rights for each table.
    I'm currently using Visual Studio 2008 Beta2 (Orcas) & I felt to share this info with you people.
     
    Moiz
    MCSD.Net 
Page 1 of 1 (8 items)
Microsoft Communities
Page view counter