title: Classic ASP, problem logging in to SQL Server using Windows Authentication
body: <p>I failed to connect using this connection string</p>
  
  <pre><code>strConnString = "Provider=SQLOLEDB;Initial Catalog=fsw;SERVER=HARDIXP\hardi;Integrated Security=SSPI;"
  </code></pre>
  
  <blockquote>
    <p>Microsoft OLE DB Provider for ODBC
    Drivers (0x80004005) [Microsoft][ODBC
    SQL Server Driver][DBMSLPCN]SQL Server
    does not exist or access denied.</p>
  </blockquote>
  
  <p>I can connect fine using SQL Server Management Studio. On the "Connect to Server" dialog, I have</p>
  
  <p>Server Name: HARDIXP
  Authentication: Windows Authentication</p>
  
  <p>After it is connected, the server looks like this</p>
  
  <p>HARDIXP (SQL Server 10.0.2531 - HARDIXP\hardi)</p>
  
  <p>If I don't specify the server name, the error will be</p>
  
  <blockquote>
    <p>Microsoft OLE DB Provider for SQL
    Server (0x80040E4D) Login failed for
    user 'HARDIXP\IUSR_GEOFFREYXP'.</p>
  </blockquote>
  
  <p>Note that it is trying a different user, probably because the database was first set up for Geoffrey, not Hardi.</p>
  
  <p>How can I connect to my local SQL Server from this Classic ASP code?</p>
  
  <p>EDIT: I am on Windows XP, IIS 5.1</p>