针对于提取远程服务器数据路径,sql server服务器运行代码报错:
因为 OLE DB 访问接口 'Microsoft.Jet.OLEDB.4.0' 配置为在单线程单元模式下运行,所以该访问接口无法用于分布式查询!
举例:
SELECT distinct a.IPAddr as tt,a.DT as rq,a.WDZ as wend,a.SDZ as shid,a.wzname,a.id,a.kfsx,a.remark,b.ckid
FROM opendatasource('Microsoft.ACE.OLEDB.12.0','Data Source="d:\ccerpbak\main.mdb";User ID=Admin;Jet OLEDB:Database Password=zs;Persist Security Info=False')...[record] a,ck_ttfbb_bak b
WHERE not exists (select 1 from ck_wenshi where a.IPAddr=ck_wenshi.tt and a.DT=ck_wenshi.rq)
AND CONVERT(CHAR(10),A.DT,120)>=CONVERT(CHAR(10),GETDATE()-1,120)
AND a.IPAddr = b.TT
分析:下载一个ACE.Oledb.12.0 for X64位的驱动,并把连接字符串Microsoft.jet.Oledb.4.0 更改为 Microsoft.ACE.OLEDB.12.0。。。
同时开区服务: exec sp_configure 'show advanced options',1
RECONFIGURE WITH OVERRIDE
exec sp_configure 'Ad Hoc Distributed Queries',1
RECONFIGURE WITH OVERRIDE
阅读(4980) | 评论(0) | 转发(0) |