Link to home
Start Free TrialLog in
Avatar of mphillip85
mphillip85Flag for United States of America

asked on

how to use windows authentication with vb .net 2003 application connecting to sql 2005

I have an application that I want the user that is logged on to use their login session as security for connecting to a database on a sql server 2005.

Or, how do I pass credentials or not to a connection string on the db connection in my app so i can open a connection to the database without hard coding an ID or password to the connection string.

Thank You.
Avatar of isaackhazi
isaackhazi

create users on the SQL Server using Enterprise Manager. Users is located under your SQL Server -> Security -> Logins.

Create a new login, and tick "SQL Authentication". Then on the database tab, click the databases you want that user to access.

Once this is done, I then used a document on MSDN to use a login screen that looks at the logins on the server.
This document can be found: http://msdn.microsoft.com/vstudio/us...redentials.asp

You will need to sit and work out what each section does, I basically copy and pasted all the programming from the document to my project, changed the database / IP settings as necessary, and then printed out the programming, looked at it, worked out what it does and made other changes from there.

Avatar of mphillip85

ASKER

I have my code already checking to see if the security group that has been assigned permissions to the database is created, if so then i check if the user that is logge on is in that security group.  

Now i need to be able to connect to a database (passthrough authentication) without having to logon again.

You know like outlook email, where you can logon to the pc then open your mail without having to put your name and or password /profile in again.
ASKER CERTIFIED SOLUTION
Avatar of isaackhazi
isaackhazi

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
Here is my conn string;

Trust Server Certificate=False;User ID=123;Tag with column collation when possible=False;Data Source="Server";Password="123";Initial Catalog=Redwood_II;DataTypeCompatibility=0;Use Procedure for Prepare=1;Auto Translate=True;Persist Security Info=True;Provider="SQLNCLI.1";MARS Connection=False;Workstation ID=PLUTO;Use Encryption for Data=False;Packet Size=4096

How do i change that to allow me to use my logon ID as windows authentication to connect to database?

Thank You
Integrated Security= True , for what I needed is Integrated Security=SSPI;