title: Error: "OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found ..."
body: <p>If I execute the following command:</p>
  
  <pre><code>select 
      * 
  from 
      OpenRowset (
          'MSDASQL',
          'Driver={Microsoft Text Driver (*.txt;*.csv)};DefaultDir=C:\;',
          'select top 10 * from C:\x.csv'
      )
  </code></pre>
  
  <p>... then Microsoft SQL Server Management Studio responds with:</p>
  
  <blockquote>
    <p>[Microsoft][ODBC Driver Manager] Data source name not found and no
    default driver specified.</p>
  </blockquote>
  
  <p>I'm running Microsoft SQL Server 2008 R2 on Win 7 x64. I've also tried it on Windows Vista x32, same error.</p>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li>Has anyone successfully run this command on Win 7 x64?</li>
  <li>Do any of you know what could be causing the T-SQL command to fail like this? </li>
  </ol>
  
  <hr>
  
  <p><strong>Update 1:</strong></p>
  
  <p>If you get an error that mentions "ad hoc queries", run the following to eliminate it:</p>
  
  <pre><code>EXEC sp_configure 'show advanced options', 1;
  GO
  RECONFIGURE;
  GO
  EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
  GO
  RECONFIGURE;
  GO
  </code></pre>
  
  <hr>
  
  <p><strong>Update 2:</strong></p>
  
  <p>It works on an out-of-the-box Win7 x64 machine, but I still can't fix this error on my machine. I'll go with "bulk insert" (see my comments below).</p>