Windows-only authentication not working

S

sid

I am trying to connect to SQL serevr using 'Windows only
Authentication'. Below is my code.
Dim strConn As String = _
"data source=localhost; " & _
"initial catalog=northwind; " & _
"integrated security=true;"
Dim conn As New SqlConnection(strConn)


Where as If I change the code to use 'Mixedmode
authentication', it is working.
Dim strConn As String = _
"data source=localhost; " & _
"initial catalog=northwind; " & _
"user id=sa;password=;"
Dim conn As New SqlConnection(strConn)
This one is working.


Do I need to change any further options in SQL server to
work in windows-only authentication?

Please help!

Thanks!
 
J

Jared

Sid,
I think it should be Integrated Security=SSPI not True
Jared

www.connectionstrings.com has the following examples for SQL Server -
SqlConnection (.NET)

Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;
- or -
Server=Aron1;Database=pubs;Trusted_Connection=True;
 
J

Jos

sid said:
I am trying to connect to SQL serevr using 'Windows only
Authentication'. Below is my code.
Dim strConn As String = _
"data source=localhost; " & _
"initial catalog=northwind; " & _
"integrated security=true;"
Dim conn As New SqlConnection(strConn)


Where as If I change the code to use 'Mixedmode
authentication', it is working.
Dim strConn As String = _
"data source=localhost; " & _
"initial catalog=northwind; " & _
"user id=sa;password=;"
Dim conn As New SqlConnection(strConn)
This one is working.


Do I need to change any further options in SQL server to
work in windows-only authentication?

Either you need to set Impersonation=True, or
you need SQL Server to allow access to the ASPNET user account.
 
S

sid

Thanks for the reply and link Jared.
I tried with all the options in the connectionstrings.com
site. I replaced 'true' with 'SSPI'. Still I am getting
the same login error.

Thanks!
 
R

Raterus

Could be 1001 different things depending on your setup/needs

Are you trying to access the sql server using the credentials of the authenticated client?
Sql Server on a computer other than your webserver?
 
N

Nick

This works for me:
Dim strConn As String = "server=" & Global.ServerName & ";database=" &
Global.DatabaseName & ";integrated security=true"


Nick

Could be 1001 different things depending on your setup/needs

Are you trying to access the sql server using the credentials of the
authenticated client?
Sql Server on a computer other than your webserver?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top