[英]Linked server “Data source name not found and no default driver specified” error
I made a linked server with Microsoft OLE DB Provider for ODBC Drivers:我使用 Microsoft OLE DB Provider for ODBC Drivers 创建了一个链接服务器:
EXEC master.dbo.sp_addlinkedserver @server = N'TEST',
@srvproduct=N'Microsoft Visual FoxPro Driver',
@provider=N'MSDASQL',
@datasrc=N'TEST'
It worked fine still I used WIndows Authentication Mode, but when I created a login user and switch to SQL AUthentication it did not work.它仍然工作正常,我仍然使用 WINdows 身份验证模式,但是当我创建登录用户并切换到 SQL 身份验证时,它不起作用。
What changes are needed to work with SQL Authentication?使用 SQL 身份验证需要进行哪些更改?
In providers I have enabled:"Nested queries","Allow inpocess", Level zero only".在我启用的提供者中:“嵌套查询”、“允许处理”、仅级别零“。
The error is:错误是:
OLE DB provider "MSDASQL" for linked server "TEST" returned message "[Microsoft][ODBC Driver Manager] Invalid connection string attribute".
链接服务器“TEST”的 OLE DB 提供程序“MSDASQL”返回消息“[Microsoft][ODBC 驱动程序管理器] 连接字符串属性无效”。 OLE DB provider "MSDASQL" for linked server "TEST" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
链接服务器“TEST”的 OLE DB 提供程序“MSDASQL”返回消息“[Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序”。 Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "TEST".
消息 7303,级别 16,状态 1,第 1 行无法初始化链接服务器“TEST”的 OLE DB 访问接口“MSDASQL”的数据源对象。
This error message can occur because of one of these problems.由于这些问题之一,可能会出现此错误消息。
One of the initialization parameters specified in sp_addlinkedserver
( data_source, location, provider_string, or catalog
) is incorrect for this provider. sp_addlinkedserver
指定的初始化参数之一( data_source, location, provider_string, or catalog
)对于此提供程序不正确。
Verify that these parameters defined for the linked server, specified by executing验证为链接服务器定义的这些参数,通过执行
sp_addlinkedserver
, are correct for the given provider. sp_addlinkedserver
,对于给定的提供程序是正确的。
Check Here also sp_addlinkedsrvlogin 在这里也检查sp_addlinkedsrvlogin
Login and password sent to the provider is invalid.发送给提供商的登录名和密码无效。
Verify that there is a valid login and password configured for the linked server and the current SQL Server login through sp_addlinkedsrvlogin
.通过
sp_addlinkedsrvlogin
验证是否为链接服务器和当前 SQL Server 登录配置了有效的登录名和密码。
UPDATE更新
During a linked server connection (for example, when it processes a distributed query), the sending server provides a login name and password to connect to the receiving server on its behalf.在链接服务器连接期间(例如,当它处理分布式查询时),发送服务器提供登录名和密码以代表其连接到接收服务器。 For this connection to work, you must create a login mapping between the linked servers by using SQL Server system stored procedures.
要使此连接正常工作,您必须使用 SQL Server 系统存储过程在链接服务器之间创建登录映射。 -- HERE and HERE
-- 这里和这里
You need to create login mapping for linked server see security for Linked Server您需要为链接服务器创建登录映射,请参阅链接服务器的安全性
Use sp_addlinkedsrvlogin使用sp_addlinkedsrvlogin
Creates or updates a mapping between a login on the local instance of SQL Server and a security account on a remote server.创建或更新 SQL Server 本地实例上的登录名与远程服务器上的安全帐户之间的映射。
sp_addlinkedsrvlogin [ @rmtsrvname= ] 'rmtsrvname'
[ , [ @useself= ] 'TRUE' | 'FALSE' | 'NULL']
[ , [ @locallogin= ] 'locallogin' ]
[ , [ @rmtuser= ] 'rmtuser' ]
[ , [ @rmtpassword= ] 'rmtpassword' ]
If the connection to the linked server works fine using Windows Authentication, but it doesn't using a SQL Server Authentication, I would have a look at the properties of the linked server and make sure, choosing the tab "Security", that both the authentication modes are enabled:如果使用 Windows 身份验证与链接服务器的连接工作正常,但不使用 SQL Server 身份验证,我将查看链接服务器的属性并确保选择“安全”选项卡,身份验证模式已启用:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.