Link to home
Start Free TrialLog in
Avatar of Steynsk
SteynskFlag for Netherlands

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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=."
Avatar of Steynsk

ASKER

Thanks