SQL访问链接服务器 [英] SQL to Access linked server

查看:88
本文介绍了SQL访问链接服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将链接服务器添加到Access数据库.我正在使用以下SQL代码来做到这一点.

I am trying to add a linked server to a Access database. I am using the following SQL code to do this.

exec sp_addlinkedserver 
@server = 'Test',
@provider = 'Microsoft.Jet.OLEDB.4.0',
@srvproduct = 'OLE DB Provider for Jet',
@datasrc = '\\srv\public$\CM Database\Data\sysConfig_dat.mdb'
go
EXEC sp_addlinkedsrvlogin Test, FALSE, Null, Admin, Null

但是当我运行这个...

but when i run this...

select * from Test...tblProduct

我收到此错误...

OLE DB提供程序 'Microsoft.Jet.OLEDB.4.0'不能为 用于分布式查询,因为 提供程序配置为在 单线程单元模式.什么 我做错了吗?

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode. what am i doing wrong?

我在32位系统上使用SQL Server Management Studio 2008.

I am using SQL Server Management Studio 2008 on a 32 bit system.

推荐答案

我知道了...

运行SQL Server的服务器是一台64位计算机.典型的数据连接组件驱动程序不适用于本机(即,将Microsoft.Jet.OleDB.4.0安装为提供程序的下载).我必须下载具有64Bit选项的Access 2010组件.

The server running SQL Server is a 64Bit machine. The typical data connectivity component drivers did not work with this machine (ie the download that installs the Microsoft.Jet.OleDB.4.0 as a provider). I had to download the components for Access 2010 which has a 64Bit option.

从下载这里

这会将Microsoft.ACE.OLEDB.12.0安装为提供程序,我可以使用BradBenning在他的帖子中提到的SQL命令.

That installs the Microsoft.ACE.OLEDB.12.0 as a provider and I can use the SQL command that BradBenning mentioned in his post.

这篇关于SQL访问链接服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆