ADODB integrated authenticantion instead of username and password authenticantion

Hallo Expert,

I am relatively new in ASP and need to switch from username+password ADODB authentication to integrated authentication ADODB.

My database is MSSQL 2005

My username+password ADODB authentication looks like this. And it is included in all my ASP sites.
Can someone please tell me how to change the code so it works with authentication to integrated authentication ADODB?

And do I have to change other parts in my code as well or only this part?  

Thanks,

Steynsk


Set CS = Server.CreateObject("ADODB.Connection")
CS.Open "DSN=MyDNS;Uid=MyUsername;Pwd=MyPassword"
 
 
query = "SELECT * FROM tablename"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open query, CS

Open in new window

LVL 1
SteynskAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
the connection string would be like this:

CS.Open "Provider=SqlOledb;Server=yoursqlsevername_or_ip;Integrated Security=SSPI;"

however, to use the end-user's windows account, only possible on intranet solutions (otherwise the asp startup account will be used...), you need to configure the iis web site to disable anonymeous access.
0
 
mironCommented:
You could grant windows account running IIS service access to SQL Server.
If SQL Server is located on remote machine you will need to configure IIS site service account to run under domain account. Here is one more example of connection string:
"Provider=SQLOLEDB;Integrated Security=SSPI;Initial Catalog=pubs;Data Source=."
0
 
SteynskAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.