Sql – authentication to sql 2005 using domain account from ASP

adoasp-classicauthenticationsql-server-2005

I cannot seem to use a Windows account to access my database from my ASP page.
Here is my connection string:
PROVIDER=SQLOLEDB;DATA SOURCE=NHA-SQL-I0;UID=DOMAIN\NHA-svcRequestForm;PWD=password;DATABASE=RequestForms

I get the classic:
Microsoft OLE DB Provider for SQL Server (0x80040E4D) Login failed for user 'NIRHB\NHA-svcRequestForm'.

This occurs for any domain account I use. Using SQL accounts works fine.
Any idea what setting/configuration I am missing?

Thanks

Best Answer

That type of connection string is used for SQL accounts; you're actually trying to connect as a SQL user named "DOMAIN\NHA-svcRequestForm".

Try somethign like this:

PROVIDER=SQLOLEDB;DATA SOURCE=NHA-SQL-I0;DATABASE=RequestForms;Trusted_Connection=YES

And whatever application is trying to connect to the database must be running as the domain user. This means the identity of the application pool must be set to your domain user (if this is a web app in IIS), or the service identity must be the domain user (if a windows service).

Related Topic