473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Windows-only authentication not working

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!
Nov 18 '05 #1
5 1869
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 ;

"sid" <an*******@discussions.microsoft.com> wrote in message
news:41****************************@phx.gbl...
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!

Nov 18 '05 #2
Jos
sid wrote:
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.

--

Jos
Nov 18 '05 #3
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!
-----Original Message-----
Sid,
I think it should be Integrated Security=SSPI not TrueJared

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=Tru e;

"sid" <an*******@discussions.microsoft.com> wrote in messagenews:41****************************@phx.gbl...
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!

.

Nov 18 '05 #4
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?

"sid" <an*******@discussions.microsoft.com> wrote in message news:41****************************@phx.gbl...
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!

Nov 18 '05 #5
This works for me:
Dim strConn As String = "server=" & Global.ServerName & ";database=" &
Global.DatabaseName & ";integrated security=true"
Nick

"Raterus" <ra*****@spam.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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?

"sid" <an*******@discussions.microsoft.com> wrote in message
news:41****************************@phx.gbl...
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!

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
5
by: david | last post by:
I have developed my web service with a domain name of my computer name and wwwroot directory. I also developed a client of windows form application. It works locally (i.e. in the same machine). ...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
1
by: freesteel | last post by:
I have posted about this problem before. SInce then I found a much better article to help with embedding python in a multithreaded application: http://www.linuxjournal.com/article/3641 I...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
2
by: sambo251 | last post by:
After running a few updates I get this very annoying "Windows Installer" error #1706 that will ne go away! It keeps saying that it cannot find the file "instantsharedevices.msi", that it is on...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
41
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.