SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问的解决方案

今天写了一个excel表的导入功能,结果在excel表中的内容导入到页面时报错:SQL  Server 阻止了对组件 ‘Ad Hoc Distributed Queries‘ 的  STATEMENT‘OpenRowset/OpenDatasource‘  的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 ‘Ad Hoc  Distributed Queries‘。有关启用 ‘Ad Hoc Distributed Queries‘ 的详细信息,请参阅 SQL  Server 联机丛书中的 "外围应用配置器"。

在网上查了查,实验了一下管用,所以记录一下:

在数据库sql查询编辑器中运行下面语句即可

1、启用 ‘Ad Hoc Distributed Queries‘:

1 exec sp_configure ‘show advanced options‘,1
2 reconfigure
3 exec sp_configure ‘Ad Hoc Distributed Queries‘,1
4 reconfigure

启用 ‘Ad Hoc Distributed Queries‘

2、关闭 ‘Ad Hoc Distributed Queries‘:

1 exec sp_configure ‘Ad Hoc Distributed Queries‘,0
2 reconfigure
3 exec sp_configure ‘show advanced options‘,0
4 reconfigure

关闭 ‘Ad Hoc Distributed Queries‘:

SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问的解决方案

时间: 2024-08-24 11:54:32

SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问的解决方案的相关文章

解决SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问的方法

报错内容是:SQL  Server 阻止了对组件 'Ad Hoc Distributed Queries' 的  STATEMENT'OpenRowset/OpenDatasource'  的访问,因为此组件已作为此服务器安全配置的一部分而被关闭.系统管理员可以通过使用 sp_configure 启用 'Ad Hoc  Distributed Queries'.有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL  Server 联机丛书中的 "外围应用

SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问

delphi ado 跨数据库访问 语句如下 select * from OPENDATASOURCE('SQLOLEDB','Data Source=server;User ID=sa;Password=123').erp_logon.dbo.yq_users where userNO = 'admin' and pwd = '040' and db = '帐套1' 报错内容是:SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT

解决SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 的访问

根据需要进行asp.net的数据导入导出,结果报以下错: SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭.系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'.有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL

SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。

今天单位一ASP.NET网站,里面有个功能是导出数据,发现一导出就报错,报错内容是:SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭.系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'.有关启用 'Ad Hoc Distributed Queries' 的详

[sql异常]SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的

//执行远程数据库表查询 select * from openrowset( 'SQLOLEDB', '192.168.5.547'; 'sa'; '密码',[数据库名称].[dbo].[表名]) 出现异常: 消息 15281,级别 16,状态 1,第 1 行SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭.系统管理员

SQL Server 启用Ad Hoc Distributed Queries的方法

SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭.系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'.有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器".

打开较大存储量的.sql文件时,出现SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问

1. “消息 15281,级别 16,状态 1,过程 xp_cmdshell,第 1 行SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭.系统管理员可以通过使用 sp_configure 启用 'xp_cmdshell'.有关启用 'xp_cmdshell' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器". ” 解决方法: sqlserver2

SQL Server阻止了对组件xp_cmdshell过程的解决方案

错误描述:SQL Server阻止了对组件'xp_cmdshell'的过程'sys.xp_cmdshell'的访问.因为此组件已作为此服务嚣安全配置的一部分而被关闭.系统管理员可以通过使用sp_configure启用'xp_cmdshell'.有关启用'xp_cmdshell'的详细信息,请参阅sQL帮助文件. [分析]: 查询网络资料以及SQL帮助可知,xp_cmdshell可以让系统管理员以操作系统命令行解释器的方式执行给定的命令字符串,并以文本行方式返回任何输出,是一个功能非常强大的扩展存

SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问

--开启 Ole Automation Procedures sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'Ole Automation Procedures', 1; GO RECONFIGURE; GO EXEC sp_configure 'Ole Automation Procedures'; GO --关闭 Ole Automation Procedures sp_configure '