不能连接远程数据库
連接sql時提示以下內容
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組件被禁用了,這里我用的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
轉載于:https://blog.51cto.com/bks2015/1606524
總結
- 上一篇: JVM参数详解和调优
- 下一篇: 漫画:什么是微服务?