然后我在网上找了一下启动的
启用Ad Hoc Distributed Queries:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
执行后还是一样,我的SQL语句如下:INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\A.mdb'; 'admin'; '', A表)
SELECT *
FROM agentmenu
启用Ad Hoc Distributed Queries:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
执行后还是一样,我的SQL语句如下:INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\A.mdb'; 'admin'; '', A表)
SELECT *
FROM agentmenu
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
1.是不是你弄错了,要导出的文件一定要在数据库所在的服务器2.字段要绑定好INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\A.mdb'; 'admin'; '', A表)(col1,col2..)
SELECT col1,col2..
FROM agentmenu
----------------------------
无法初始化链接服务器"(null)"的OLE DB 访问接口 "Microsoft Jet.OLEDB 4.0" 的数据源对像
GO
RECONFIGURE
GO
sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO
exec sp_configure ''show advanced options'',1
reconfigure
exec sp_configure ''Ad Hoc Distributed Queries'',1
reconfigure
我测试了一下,没有问题的
insert INTO
OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\A.mdb'; 'admin'; '', 表A)
select '1'确保你的access文件在sql所在的服务器上
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure