cableload
cableload

Reputation: 4375

connecting to sql server from classic asp

I have a sql server 2008R2 express running in windows authentication mode. I created a login and a user for a database in sql server based on a windows account. I can connect to sql server database via(run as the user) SSMS and browse my database just fine.

Now i am trying to connect via a 3rd party asp application

set loginDB = Server.CreateObject("ADODB.Connection")

'For Windows Server 2008 / SQL 2008 users, please use the following line for the DB connection

loginDB.Open "Provider=SQLNCLI10; Server=(local)\SQLServerName; Database=dbname;Uid="myuser" Pwd="pwd""

I am getting an error saying login failed for user myuser

Also the site is running on an app pool which i have set it to run as the windows user myuser.

Where am i going wrong???

Thanks.

Upvotes: 0

Views: 3518

Answers (1)

Tony Hopkinson
Tony Hopkinson

Reputation: 20320

If you are passing username and password that's SQL Server Authentication not windows, so if it's authentication mode is Windows only, it won't have it.

Take them out and replace with Integrated Security = SSPI

Upvotes: 1

Related Questions