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.
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.
mariolopes
Participant
1259 Points
586 Posts
Record(s) cannot be read; no read permission on 'MSysObjects'.
Mar 27, 2006 03:45 PM|LINK
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
http://www.mariolopes.com
deokule2003
Participant
1786 Points
356 Posts
Re: Record(s) cannot be read; no read permission on 'MSysObjects'.
Mar 27, 2006 05:59 PM|LINK
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
Blog: http://dkuldeep.blogspot.com
This posting is provided "AS IS" with no warranties, and confers no rights.
mariolopes
Participant
1259 Points
586 Posts
Re: Record(s) cannot be read; no read permission on 'MSysObjects'.
Mar 28, 2006 09:13 AM|LINK
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
http://www.mariolopes.com
deokule2003
Participant
1786 Points
356 Posts
Re: Record(s) cannot be read; no read permission on 'MSysObjects'.
Mar 28, 2006 12:03 PM|LINK
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
Blog: http://dkuldeep.blogspot.com
This posting is provided "AS IS" with no warranties, and confers no rights.
mariolopes
Participant
1259 Points
586 Posts
Re: Record(s) cannot be read; no read permission on 'MSysObjects'.
Mar 28, 2006 02:39 PM|LINK
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...
http://www.mariolopes.com
deokule2003
Participant
1786 Points
356 Posts
Re: Record(s) cannot be read; no read permission on 'MSysObjects'.
Mar 29, 2006 06:06 PM|LINK
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
Blog: http://dkuldeep.blogspot.com
This posting is provided "AS IS" with no warranties, and confers no rights.
kenbati
Member
234 Points
408 Posts
Re: Record(s) cannot be read; no read permission on 'MSysObjects'.
Aug 03, 2007 02:40 AM|LINK
Very good Kuldeep; On quick question. On the same lines how do one see Field names and their types? thanks in Advance
data access
Our economy is bad due to corruption and monoply!
moizdhanji
Member
2 Points
1 Post
Re: Record(s) cannot be read; no read permission on 'MSysObjects'.
Aug 08, 2007 03:59 PM|LINK
database Odbc access c# mdb AccessDataSource INSERT problem Access database query string vb.net asp.net Access Database - FileDSN in ASP.NET 2.0 Access Database data access OLEDB - Relative Connection string accessdatabase Microsoft Access Database Delete .aspx.vb .Net 2.0 ASP.NET 2.0