title: Error-Unable to open BCP host file data, while executing BCP command
body: <p>I'm trying to copy data from a '.dat' file to a table in sql server
  I'm getting this error while executing the following commands:</p>
  
  <pre><code>declare @cmd varchar(100)
  set @cmd = 'bcp dBFCLogging.dbo.TempBFCLogs in ' + '''D:\WorkArea\data.dat''' + ' -c -T'
  exec xp_cmdshell @cmd
  </code></pre>
  
  <p>The exact error message:</p>
  
  <pre><code>SQLState = S1000, NativeError = 0
  Error = [Microsoft][SQL Server Native Client 10.0]Unable to open BCP host data-file
  NULL
  </code></pre>
  
  <p>I ran a print command and checked the cmd variable, and that looks okay.</p>
  
  <pre><code>bcp dBFCLogging.dbo.TempBFCLogs in 'D:\WorkArea\data.dat' -c -T
  </code></pre>
  
  <p>I'm running this command on a DB server, so I have this file under the correct path on that DB server. I had read that there could be permission issues. So, I have enabled the user 'Everyone' to have Read/Execute access on that folder structure and also the file, but it still throws this error while execution.
  Please help!</p>