简体   繁体   English

链接服务器“未找到数据源名称且未指定默认驱动程序”错误

[英]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 登录配置了有效的登录名和密码。

Go through this Article通过这篇文章

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.

相关问题 未找到数据源名称,且未指定默认驱动程序 - Data source name not found, and no default driver specified 找不到数据源名称,并且未指定默认驱动程序 - Data source name not found and no default driver specified PYODBC--未找到数据源名称且未指定默认驱动程序 - PYODBC--Data source name not found and no default driver specified Azure Runbook 中未找到数据源名称且未指定默认驱动程序 - Data source name not found and no default driver specified in Azure Runbook sqlsrv_connect:找不到数据源名称,并且未指定默认驱动程序 - sqlsrv_connect: Data source name not found and no default driver specified pyodbc.Error:找不到数据源名称,并且没有指定默认驱动程序(0)(SQLDriverConnect)') - pyodbc.Error: Data source name not found, and no default driver specified (0) (SQLDriverConnect)') 无法连接到数据库错误:java.sql.SQLException:[Microsoft] [ODBC驱动程序管理器]找不到数据源名称并且未指定默认驱动程序 - Cannot connect to database Error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [Microsoft] [ODBC驱动程序管理器]找不到数据源名称且未指定默认驱动程序-在IDE中工作正常-一次没有导出 - [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified - works fine in IDE - not once exported 数据库 - [Microsoft] [ODBC驱动程序管理器]未找到数据源名称且未指定默认驱动程序 - Database - [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 错误:“OLE DB提供程序”MSDASQL“用于链接服务器”(null)“返回消息”[Microsoft] [ODBC驱动程序管理器]未找到数据源名称...“ - Error: “OLE DB provider ”MSDASQL“ for linked server ”(null)“ returned message ”[Microsoft][ODBC Driver Manager] Data source name not found …"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM