473,320 Members | 1,940 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,320 software developers and data experts.

Error: Login failed for user ????

Please Help me. I've got a .Net 2003 program that attaches to a SQL Server
machine and I'm getting the above error when a user tries to log in. The SQL
server is setup to use Windows Auth. and I have added the new user to the
database and have given the user access to the database for the app. But
everytime I try and login using this users ID, I always get the error:
Login failed for user Christian.Gaut
If I login using my userid and password, the program works fine, but if I
login (into windows) as the user and try it again, same thing happens. I
tried putting the userid and password(windows) in the connect string, but
that is not helping either. Now, in the user properties of the database, it
won't allow me to change the password for the user (I guess cause I'm using
Windows Auth). So should I leave the password blank in the connect string?
Any help would be great, thanks again for taking the time to stop by.
Michael

Apr 4 '06 #1
12 6512
jvb
Can u post the connection string you are using?

Apr 4 '06 #2
The connect string is as follows:
"User=Christian.Gaut Password=??? packet size=4096;integrated
security=SSPI;data source=BACKUPSVR\BKUPEXEC;persist security
info=False;initial catalog=NF_Inventory"

Now I've only put the userid and password here for testing only. I can leave
that in, and login into my machine(using my ID) and it will work. Any ideas.
Thanks
Michael
"jvb" wrote:
Can u post the connection string you are using?

Apr 4 '06 #3
Michael wrote:
Please Help me. I've got a .Net 2003 program that attaches to a SQL Server
machine and I'm getting the above error when a user tries to log in. The SQL
server is setup to use Windows Auth. and I have added the new user to the
database and have given the user access to the database for the app. But
everytime I try and login using this users ID, I always get the error:
Login failed for user Christian.Gaut
If I login using my userid and password, the program works fine, but if I
login (into windows) as the user and try it again, same thing happens. I
tried putting the userid and password(windows) in the connect string, but
that is not helping either. Now, in the user properties of the database, it
won't allow me to change the password for the user (I guess cause I'm using
Windows Auth). So should I leave the password blank in the connect string?
Any help would be great, thanks again for taking the time to stop by.
Michael


Can you explain this:
If I login using my userid and password, the program works fine, but if
I login (into windows) as the user and try it again, same thing happens.

Are you logging into a domain?
Chris
Apr 4 '06 #4
jvb
If you are using SSPI, you do not need to enter a specific Username and
password. If you log onto the domain, you may need to have the name
qualified in the database's users list; <domain>\<user>.

Apr 4 '06 #5
Sorry about that Chris.
We are running on a domain. If I'm using Windows Auth, is the Userid and
Password in the connection string even used?

Ok here is what I have so far:
I login Windows(using my UserId and password), Run application, I can get
into the database with any problems.

I Login Windows(Using the Users ID and Password). In otherwords my
client(co-worker, ect). App starts, but as soon as it tries to access the
database I get the following error:
Login failed for user 'NARCO??????\Christian\Gaut'.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.SqlClient.SqlException: Login failed for user
'NARCOFREEDOM\christian.gautier'.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at NF_Inventory.frmProductStatus.frmProductStatus_Loa d(Object sender,
EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
NF_Inventory
Assembly Version: 1.0.2285.14544
Win32 Version: 1.0.2285.14544
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/NF_Inventory.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
PinkieControls
Assembly Version: 1.0.1362.15156
Win32 Version: 1.0.1362.15156
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/PinkieControls.DLL
----------------------------------------
C1.Win.C1List
Assembly Version: 1.1.20053.86
Win32 Version: 1.1.20053.86
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/C1.Win.C1List.DLL
----------------------------------------
System.Design
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.design/1.0.5000.0__b03f5f7f11d50a3a/system.design.dll
----------------------------------------
C1.Win.C1TrueDBGrid
Assembly Version: 1.3.20052.50624
Win32 Version: 1.3.20052.50624
CodeBase:
file:///C:/Program%20Files/Narco/NF_Inventory/C1.Win.C1TrueDBGrid.DLL
----------------------------------------
C1.Common
Assembly Version: 1.0.20031.116
Win32 Version: 1.0.20042.118
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/C1.Common.DLL
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3052.4
CodeBase:
file:///c:/winnt/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
Microsoft.VisualBasic.Compatibility
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3077
CodeBase:
file:///C:/Program%20Files/Narco/NF_Inventory/Microsoft.VisualBasic.Compatibility.DLL
----------------------------------------
System.EnterpriseServices
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.enterpriseservices/1.0.5000.0__b03f5f7f11d50a3a/system.enterpriseservices.dll
----------------------------------------

I hope this helps some. Thanks for any suggestions.
Michael

Apr 4 '06 #6
I also wanted to know if any Windows security setting could cause SQL Server
access problems. For example, the user that I'm trying to get access for,
will not have admin rights to his machine, as will most users here. Could one
of these settings be causing problems with SQL Server since I'm using Windows
Auth security in SQL Server. Thanks again.
Michael
P.S. I'm researching now to try and find the answer to my problem, and the
above question came from one of my readings.

Apr 4 '06 #7
Michael wrote:
Sorry about that Chris.
We are running on a domain. If I'm using Windows Auth, is the Userid and
Password in the connection string even used?

Ok here is what I have so far:
I login Windows(using my UserId and password), Run application, I can get
into the database with any problems.

I Login Windows(Using the Users ID and Password). In otherwords my
client(co-worker, ect). App starts, but as soon as it tries to access the
database I get the following error:
Login failed for user 'NARCO??????\Christian\Gaut'.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.SqlClient.SqlException: Login failed for user
'NARCOFREEDOM\christian.gautier'.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at NF_Inventory.frmProductStatus.frmProductStatus_Loa d(Object sender,
EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
NF_Inventory
Assembly Version: 1.0.2285.14544
Win32 Version: 1.0.2285.14544
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/NF_Inventory.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
PinkieControls
Assembly Version: 1.0.1362.15156
Win32 Version: 1.0.1362.15156
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/PinkieControls.DLL
----------------------------------------
C1.Win.C1List
Assembly Version: 1.1.20053.86
Win32 Version: 1.1.20053.86
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/C1.Win.C1List.DLL
----------------------------------------
System.Design
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.design/1.0.5000.0__b03f5f7f11d50a3a/system.design.dll
----------------------------------------
C1.Win.C1TrueDBGrid
Assembly Version: 1.3.20052.50624
Win32 Version: 1.3.20052.50624
CodeBase:
file:///C:/Program%20Files/Narco/NF_Inventory/C1.Win.C1TrueDBGrid.DLL
----------------------------------------
C1.Common
Assembly Version: 1.0.20031.116
Win32 Version: 1.0.20042.118
CodeBase: file:///C:/Program%20Files/Narco/NF_Inventory/C1.Common.DLL
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3052.4
CodeBase:
file:///c:/winnt/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
Microsoft.VisualBasic.Compatibility
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3077
CodeBase:
file:///C:/Program%20Files/Narco/NF_Inventory/Microsoft.VisualBasic.Compatibility.DLL
----------------------------------------
System.EnterpriseServices
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.enterpriseservices/1.0.5000.0__b03f5f7f11d50a3a/system.enterpriseservices.dll
----------------------------------------

I hope this helps some. Thanks for any suggestions.
Michael


Make sure you add users to the server as
"NARCOFREEDOM\christian.gautier" It will not detect user
"christian.gautier" the same as user "NARCOFREEDOM\christian.gautier"

Chris
Apr 4 '06 #8
Hi Everyone,
Here is some additional info that might help. I have the follwoing setup in
Enterprise Manager.
Server -> Security -> Logins -> General Tab
The name is listed as 'NARCO??????\christian.gaut
The properties for this user are set as:
Windows Authentication
Domain = NARCO?????? (but grayed out)
Security Access = Grant
and the default database is set.
Server Role Tab:
Nothing set here.
Database Access:
Only the database that needs accessing is checked for permission.

Now if I look in the follwoing
Database -> Users (Users for this database)
The name is christian.gaut and the Login Name value includes the domain and
has Permit access to db.
The properties are set as followed:
Permit in Database Role:
Public, db_owner, db_datareader, db_datawriter are checked.
and for the permissions I set every possible option (Select, insert, update
and delete) for all the tables and SP's.

I hope this helps.
Michael

Apr 4 '06 #9
Hi Everyone,
I have a question about something I read in the online help.
<Quote
When a network user tries to connect, SQL Server uses Windows-based
facilities to determine the validated network user name. SQL Server then
verifies that the person is who they say they are, and then permits or denies
login access based on that network user name alone, without requiring a
separate login name and password.
/>
Does this mean that the password needs to be set in SQL Server. I ask,
because, since I have Windows Auth set for the database, I can't change any
of the users passwords.
I was trying to do a test and just setup the db so that it uses only SQL
Auth, but when I try to change it to SQL Auth I get an error:
SQL Server registration failed because of the connection failure.
Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server
connection.

I was thinking of changing over to SQL Auth to make it easier (If I've got
to go through this each time I add a new user). What do you all think? I've
heard that Windows Auth is better than plain SQL Auth. Why? How about
creating a single userid and password on the server and user that combo in
the connect string to connect to the db. I hope I can get Windows Auth to
work, so I won't have to go in this direction. Thanks for any help & comments.
Michael
"Michael" wrote:
Please Help me. I've got a .Net 2003 program that attaches to a SQL Server
machine and I'm getting the above error when a user tries to log in. The SQL
server is setup to use Windows Auth. and I have added the new user to the
database and have given the user access to the database for the app. But
everytime I try and login using this users ID, I always get the error:
Login failed for user Christian.Gaut
If I login using my userid and password, the program works fine, but if I
login (into windows) as the user and try it again, same thing happens. I
tried putting the userid and password(windows) in the connect string, but
that is not helping either. Now, in the user properties of the database, it
won't allow me to change the password for the user (I guess cause I'm using
Windows Auth). So should I leave the password blank in the connect string?
Any help would be great, thanks again for taking the time to stop by.
Michael

Apr 4 '06 #10
jvb
You may want to post some of these questions to the SQL server group,
they may be able to help you a little more.

Apr 4 '06 #11
you sure you're not trying to double - hop authentication or anything
like that?/

Apr 5 '06 #12
if you have AD GROUPS setup you wouldn't need to add a new user to
anything; just add the group.

that way you create the user in one place (in Windows AD) and you're
done

Apr 5 '06 #13

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

Similar topics

0
by: DukeNM | last post by:
I have a ms sql database server backup maintainance. I have scheduled for backup daily at 11:00 pm however the backup doesnt take place. after lookin at the logs it shows me.... Login...
3
by: Mr.KisS | last post by:
Hello all, I'm working with Windows XP PRO SP1, ASP.NET v2 (with Visual Web Dev) and, MS SQL 2005 with a database with Windows Authentication mode. I've an aspx page which must send a query to...
0
by: amos hchmon | last post by:
What means this error? I just do a simple fill dataset and data bind to datagrid.
1
by: Javier Gogol | last post by:
error Login failed. Details: crdb_adoplus Plis help me, not display report : ( crystal report - ASP.Net "c#" - SQLServer2000 - VS.Net 2005 ) in browser ... ????
0
by: Don | last post by:
When I attempt to access a SQL Server database from my ASP.NET 1.1 application I get the folllowing error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server...
5
by: CFTK | last post by:
we´re having problems to put our Website at IIS: We have achieved it all works using the connectionString with user and password of the superuser (sa), but with IntegratedSecurity we get the...
1
by: NannMaw | last post by:
Hi,good evening all. I am a beginner in web development and SQL server. I got the below error when running the web application on development server of MS visual studio 2005. I guess that...
4
by: Brett | last post by:
I have an ASP.NET 2.0 application that uses Forms Authentication. The startup page contains just a login control, and the site works well on an IIS 6 web server. I am now setting the site up on...
1
by: SantyBhi | last post by:
Hi , ...i am developing web Site in asp.Net. When i Run Web Site using Visual studio i dont get the error.it works fine ...But When i run WebSite by publishing on IIS .i am getting the following...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.