解决SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问的方法
2015-11-26 12:57
615 查看
解决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'。有关启用 'AdHoc Distributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。
看错误提示就知道是因为SQL Server的Ad Hoc Distributed Queries组件被禁用了,这里我用的SQL Server版本是2005,只需要开启Ad Hoc Distributed Queries就可以了,方法如下:
1.开启Ad Hoc Distributed Queries组件,在sql查询编辑器中执行如下语句:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
2.关闭Ad Hoc Distributed Queries组件,在sql查询编辑器中执行如下语句:
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure
相关文章推荐
- Ultra-QuickSort(树状数组+离散化)
- ACM学习历程—UESTC 1222 Sudoku(矩阵)(2015CCPC H)
- easyui--draggable 拖动
- 76 What is the effect of increasing the value of the ASM_POWER_LIMIT parameter? A. The number of DBW
- UITextView 的一些用途
- 两个对象值相同(x.equals(y) == true),但却可有不同的hash code,这句话对不对?
- 从UE3到UE4
- 详解iOS的UI开发中控制器的创建方法
- ACM学习历程—UESTC 1226 Huatuo's Medicine(数学)(2015CCPC L)
- ueditor 编辑器,自定义图片上传及图片显示
- ACM学习历程—UESTC 1215 Secrete Master Plan(矩阵旋转)(2015CCPC A)
- 73 Which two are the prerequisites to enable Flashback Data Archive? (Choose two.) A. Database must
- UITableVIew 编辑
- iOS开发日记48-详解UIPickerView
- Apue Chapter 7 习题答案
- 自定义UINavigationController 切换动画
- 进击的KFC:UI(六)UISegmentControl,UISlider,NSTimer,UIImageView
- 根据Excel单元格坐标修改单元格内的Value
- <merge/>标签在UI界面中的优化作用
- easyUI 验证控件应用、自定义、扩展验证 手机号码或电话话码格式