到链接服务器的测试连接现在失败

问题描述 投票:0回答:1

我在MS SQL Server数据库中有几个链接服务器,从中我可以成功查询一段时间。现在,当我测试与那些链接服务器的连接时,连接失败。错误消息是:

与链接服务器的测试连接失败。

附加信息:

执行Transact-SQL语句或批处理时发生异常。 (Microsoft.SqlServer.ConnectionInfo)

无法为链接服务器“ blah”初始化OLE DB提供程序“ Microsoft.ACE.OLEDB.12.0”的数据源对象。链接服务器“ blah”的OLE DB访问接口“ Microsoft.ACE.OLEDB.12.0”返回消息“未指定错误”。 (Microsoft SQL Server,错误:7303)

我的版本是:Microsoft SQL Server 2017(RTM-GDR)(KB4505224)-14.0.2027.2(X64)2019年6月15日00:26:19版权所有(C)2017 Windows 10 Pro 10.0(内部版本18362)上的Microsoft Corporation Express Edition(64位): )我的Office版本是Office 365。

我最初是根据https://www.excel-sql-server.com/excel-import-to-sql-server-using-linked-servers.htm设置我的链接服务器的>

我仔细检查了文件路径,它是正确的。我尝试删除并重新创建链接的服务器,但遇到相同的错误。

sp_configure 'show advanced options', 1;  
RECONFIGURE;
GO 

sp_configure 'Ad Hoc Distributed Queries', 1;  
RECONFIGURE;  
GO 

EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'AllowInProcess' , 1
GO

EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
GO

sp_dropserver 'blah', 'droplogins'; 

EXEC sp_addLinkedServer
    @server= 'blah',
    @srvproduct = 'Excel',
    @provider = 'Microsoft.ACE.OLEDB.12.0',
    @datasrc = 'C:\myfile.xlsx',
    @provstr = 'Excel 12.0;IMEX=1; HDR=Yes';
GO

我在MS SQL Server数据库中有几个链接服务器,从中我可以成功查询一段时间。现在,当我测试与那些链接服务器的连接时,连接失败。...

sql-server excel linked-server
1个回答
0
投票

检查驱动器上的权限。尝试从sql主机或使用xp_cmdshell dir

© www.soinside.com 2019 - 2024. All rights reserved.