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

Posted on 2009-02-09
Medium Priority
Last Modified: 2012-05-06
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.
Question by:mphillip85
  • 3
  • 3

Expert Comment

ID: 23596634

Expert Comment

ID: 23596642
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.


Author Comment

ID: 23596681
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.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Accepted Solution

isaackhazi earned 1500 total points
ID: 23596720
Do you mean something lie this

connstring = "Data Source=myserver;Initial Catalog=databasename;Integrated Security=True"

Author Comment

ID: 23607521
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

Author Closing Comment

ID: 31544835
Integrated Security= True , for what I needed is Integrated Security=SSPI;

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question