title: Using PDO's odbc to connect to a MSSQL server instance with Windows Authentication
body: <p>I'm trying to connect to a MSSQL database using PDO with odbc. I'm aware that there's a package <code>SqlSrv</code> (but for some reason that package (<code>.dll</code>) won't load properly). So I found some documentation arguing it's also possible with PDO. In my <code>PHP.ini</code> I've enabled the extension <code>php_pdo_odbc.dll</code> and it loads fine.</p>
  
  <p>My connection string looks like this:</p>
  
  <pre><code>$conn = new PDO(
      'odbc:
          Driver=SQL Server;
          Server=MyServer\MyInstance;
          Database=MyDatabaseName;
          Trusted Connection=Yes;',
      'MyWindowsUserName',
      'MyWindowsPassword'
  );
  </code></pre>
  
  <p>I've tried various properties (for example by prepending the domain to the username, switching with the authentication options User Id, UID, Password, PWD and Trusted Connection) but I keep getting the message </p>
  
  <blockquote>
    <p>SQLSTATE[28000] SQLDriverConnect: 18456 [Microsoft][ODBC SQL Server
    Driver][SQL Server]Login failed for user 'MyWindowsUserName'.</p>
  </blockquote>
  
  <p>Any suggestions on how to connect to the database with my Windows Account? (that's the only way for me to connect to the database)</p>