title: DSN tests ok, but login failure trying to use the DSN to SQL Server 2005
body: <p>I'm writing a small ASP.NET application in a hosted environment (meaning I don't own the server).</p>
  
  <p>Using the hosting provider's webtools, I created a DSN that specifies the Driver, the Server, the UID, the PWD, and the Database. When I test the connection, it tests out fine.</p>
  
  <p>However, when I load my web page with the code:</p>
  
  <pre>
  OdbcConnection DB = new OdbcConnection("DSN=MyDSNName");
  DB.Open();
  </pre>
  
  <p>I get the error: ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''.</p>
  
  <p>I know I'm using the correct DSN name because when I change to "DSN=NonExistentDSN" I get a different error.</p>
  
  <p>I don't understand why the logon works when I test it but not when I use it in code. Since I don't own the server, some of the usual troubleshooting tools aren't available to me, but I'd appreciate any feedback the community has.</p>