SELECT  *
FROM  OPENDATASOURCE(
         'SQLOLEDB',
         'Data Source=computer;User ID=sa;Password=sa'
         ).a..a提示:消息 15281,级别 16,状态 1,第 1 行
SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。请问然后启用: 'Ad Hoc Distributed Queries'

解决方案 »

  1.   

    运行以下:EXEC sp_configure 'show advanced option', '1';EXEC sp_configure 'Ad Hoc Distributed Queries','1'
    RECONFIGURE WITH OVERRIDE;
      

  2.   

    消息 7313,级别 16,状态 1,第 1 行
    为链接服务器 "(null)" 的访问接口 "SQLNCLI" 指定了无效的架构或目录。
      

  3.   

    SELECT  *
    FROM  OPENDATASOURCE(
             'SQLOLEDB',
             'Data Source=computer;User ID=sa;Password=sa'
             ).a.dbo.a这回对了,非常感谢,结帐!