Click here to Skip to main content
15,881,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please help, this is the error i am getting


Record(s) cannot be read; no read permission on 'MSysObjects
(I am using Access 2007)

VB
Dim ds As New DataSet<br mode=" provider="Microsoft.Jet.OLEDB.4.0;Data" source="D:\Sample.mdb")<br" mode="hold" />        cn.Open()
        Dim cmd As New OleDbCommand("SELECT Name FROM MSysObjects WHERE type=1 and flags=0", cn)
        Dim dr As OleDbDataReader
        dr = cmd.ExecuteReader()
        While (dr.Read())
            ListView1.Items.Add(dr.GetValue(0).ToString())
        End While

The above is my code, how do i solve this permission
Posted
Updated 30-May-11 21:27pm
v3

1 solution

Use the code below to get table names in mdb:

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


If you wish to give permission to MSysObjects follow instruction below:
1) Tools -> Options, on the view tab check 'system object'.
2) Tools -> Security -> User and group permissions, on each of the new tables give it 'administrator' access.

Source @ http://blogs.microsoft.co.il/blogs/dbaces/archive/2009/12/07/record-s-cannot-be-read-no-read-permission-on-msysobjects.aspx[^]
 
Share this answer
 
Comments
amitk_189 31-May-11 3:37am    
But i want only table name in Listview, not in Datagrid
amitk_189 31-May-11 3:37am    
How do i write query
Wild-Programmer 31-May-11 4:03am    
I gave an example. From the data table you can copy the table names in Listview or whatever control you want.
Maciej Los 31-May-11 15:46pm    
This is it. For me 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900