访问MS Access 系统表 MSysObjects ,在SQL SERVER 2005中访问

首先设置MS Access,给予访问MSysObjects 的权限

1. Open Microsoft Access
2. From the Tools menu, select the Options menu option
3. On the View tab, click the System Objects checkbox
4. Click OK to save your changes
5. From the Tools menu, select the Security -> User and Group Permissions menu option
6. Click the Permissions tab
7. Select the Table entry in the Object Type combo box
8. Select the Admin userid in the User/Group Name listbox
9. In the Object Name listbox, select the MSysObjects entry
10. In the Permissions group box, check the Read Data check box
工具-->选项-->视图-->系统对象打勾

工具-->安全-->用户与组权限-->对象名称MSysObjects ,权限 读取数据 打勾

OK,可以Access中访问了,如果要在SQL SERVER 2005中访问,可以在

select * from OPENROWSET('Microsoft.Jet.OLEDB.4.0','d:\SPS_Pool_Export-2007-data.mdb';'admin';'',MSysObjects)

如果出错

Msg 15281, Level 16, State 1, Line 1
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure.
 For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.

SQL Server2005没有设置的原因

exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

posted on 2008-11-04 10:31  lwl0606  阅读(447)  评论(0编辑  收藏  举报

导航

我要啦免费统计