本文介绍了Access DB中无权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了ms-office2007.我检查我的表是否存在于access(.accdb)数据库中.我在下面编写查询:
''从MSysObjects中的MSysObjects.Name =表名中选择MSysObjects.Name''
以上查询正在MS-Access 2007中运行.

当上述查询通过vb.net运行时,它们会出现错误msg(没有读取权限MSysObjects")

I have install ms-office 2007. I check that my table is exist in access(.accdb) database. I write the query in below:
''SELECT MSysObjects.Name FROM MSysObjects WHERE MSysObjects.Name = tablename''
this above query is running in MS-Access 2007.

When this above query is running through vb.net their arise a error msg (''no read permission MSysObjects'')

推荐答案

Dim dtTables As New DataTable
Dim tempConn As New OleDb.OleDbConnection(gblstrConnectionString)

If tempConn.State <> ConnectionState.Open Then
    tempConn.Open()
End If

Dim tblRestrictions As String() = New String() {Nothing, Nothing, Nothing, "TABLE"}
dtTables = tempConn.GetSchema("tables", tblRestrictions)

'Now you have a table full of information about the tables in the database

For Each row as DataRow In dtTables.Rows 'Loop through each table
   'Add code here to do whatever you want with each table,
   'for example if you want to get the table name:
   Dim strTableName as String = row("Table_Name").ToString.Trim
Next



这篇关于Access DB中无权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-30 11:21