sql server2008R2 连接access

management studio--->服务器对象-->链接服务器-->Microsoft.Jet.OLEDB.4.0-->右键属性-->访问接口选项:全都不选


2.--启用Ad Hoc Distributed Queries:

exec sp_configure 'show advanced options',1

reconfigure

exec sp_configure 'Ad Hoc Distributed Queries',1

reconfigure

3.执行语句

   3.1本地访问:SELECT * 
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="F:\share\att2000.mdb";User ID=admin;Password=')...[tablename]


   3.1共享访问SELECT * 
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="\\192.168.1.13\share\att2000.mdb";User ID=admin;Password=')...[tablename]

     说明:tablename前面的三个点不能少

4.哈哈哈哈!大功告成,数据出来了!

5.使用完记得关闭:

关闭Ad Hoc Distributed Queries组件,在sql查询编辑器中执行如下语句:
 
exec sp_configure 'Ad Hoc Distributed Queries',0
 reconfigure
 exec sp_configure 'show advanced options',0
 reconfigure

你可能感兴趣的:(sql server2008R2 连接access)