zoukankan      html  css  js  c++  java
  • 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':
    努力不给自己一点懒惰的理由,否则你会一蹶不振
  • 相关阅读:
    js38---门面模式
    js37---Function.prototype
    js36---函数嵌套
    js35
    js34
    js33--责任链模式
    js32---CommonUtil.js
    龙芯服务器参数
    SQLSERVER 秘钥整理
    IOMETER的简单使用
  • 原文地址:https://www.cnblogs.com/chao0219/p/4535294.html
Copyright © 2011-2022 走看看