473,406 Members | 2,312 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,406 software developers and data experts.

Login failed for user '<COMPUTER_NAME>\ASPNET'

I wrote ASP.NET application that access SQL Server database. When I run the
application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'"
error message.

I then did the following, but still didn't work. Any ideas??

1. In IIS console, right click the virtual directory
2. click directory security tab
3. click edit button on anonymous access
4. click browse button
5. select <COMPUTER_NAME>\ASPNET, and uncheck anonymous access

Nov 18 '05 #1
5 2362
well either you will have to use sql authentication and remove windows
authentication as it stands now

or you will have to as aspnet user to have access to the database you are
trying to use

HTH

HD

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
I wrote ASP.NET application that access SQL Server database. When I run the application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'"
error message.

I then did the following, but still didn't work. Any ideas??

1. In IIS console, right click the virtual directory
2. click directory security tab
3. click edit button on anonymous access
4. click browse button
5. select <COMPUTER_NAME>\ASPNET, and uncheck anonymous access

Nov 18 '05 #2
The message is coming from SQL Server - which does not recognize the ASPNET
user... so, you need to configure SQL Server to recognize the account. You
have a few options for accomplishing this - all depending on your usage
scenario. SQL Server's Books Online has some great documentation on the
relevant issues.

You don't have to "remove windows authentication as it stands now" - there
is no such thing.

HTH

Jeff - MCDBA

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
I wrote ASP.NET application that access SQL Server database. When I run the application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'"
error message.

I then did the following, but still didn't work. Any ideas??

1. In IIS console, right click the virtual directory
2. click directory security tab
3. click edit button on anonymous access
4. click browse button
5. select <COMPUTER_NAME>\ASPNET, and uncheck anonymous access

Nov 18 '05 #3
FYI,

I just did a revoke on 'Select' on two tables for aspnet windows user
account
and i can still access them using asp.net

i am connecting to the db using sql authentication....

the moment i set the connection string to be using trusted connection it
fails.

so you i think i was right to an extent when i said one of the options was
to use sql authentication instead of windows authentication for sql server
conneciton string

HD

"Jeff S" <Je******@asdf.com> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl...
The message is coming from SQL Server - which does not recognize the ASPNET user... so, you need to configure SQL Server to recognize the account. You
have a few options for accomplishing this - all depending on your usage
scenario. SQL Server's Books Online has some great documentation on the
relevant issues.

You don't have to "remove windows authentication as it stands now" - there
is no such thing.

HTH

Jeff - MCDBA

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
I wrote ASP.NET application that access SQL Server database. When I run

the
application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'"
error message.

I then did the following, but still didn't work. Any ideas??

1. In IIS console, right click the virtual directory
2. click directory security tab
3. click edit button on anonymous access
4. click browse button
5. select <COMPUTER_NAME>\ASPNET, and uncheck anonymous access


Nov 18 '05 #4
ok but can i change to sql authentication? Since this is the question when I
install SQL Server.
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:Oo**************@TK2MSFTNGP11.phx.gbl...
FYI,

I just did a revoke on 'Select' on two tables for aspnet windows user
account
and i can still access them using asp.net

i am connecting to the db using sql authentication....

the moment i set the connection string to be using trusted connection it
fails.

so you i think i was right to an extent when i said one of the options was
to use sql authentication instead of windows authentication for sql server
conneciton string

HD

"Jeff S" <Je******@asdf.com> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl...
The message is coming from SQL Server - which does not recognize the

ASPNET
user... so, you need to configure SQL Server to recognize the account. You have a few options for accomplishing this - all depending on your usage
scenario. SQL Server's Books Online has some great documentation on the
relevant issues.

You don't have to "remove windows authentication as it stands now" - there is no such thing.

HTH

Jeff - MCDBA

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
I wrote ASP.NET application that access SQL Server database. When I run
the
application, it yields "Login failed for user

'<COMPUTER_NAME>\ASPNET'" error message.

I then did the following, but still didn't work. Any ideas??

1. In IIS console, right click the virtual directory
2. click directory security tab
3. click edit button on anonymous access
4. click browse button
5. select <COMPUTER_NAME>\ASPNET, and uncheck anonymous access



Nov 18 '05 #5
Matthew,
You may already be aware of this, but in case you're not, this might be
helpful to know:

SQL Server runs in two authentication modes:
1. Windows Authentication Mode
2. Mixed Mode (which is Windows Authentication + SQL Server authentication)

In Windows Authentication mode, SQL Server trusts/allows in only users who
have been successfully authenticated by a Windows Domain controller (in this
mode, SQL Server does not maintain its own list of user IDs and passwords
that have been defined in SQL Server - as the ability to define users in SQL
Server is disabled)

In Mixed mode, SQL Server will additionally permit any users who have been
defined in SQL Server, itself (in these cases, SQL Server maintains its own
list of user IDs and passwords that have been defined in SQL Server).

Just to be clear, there is no such thing as removing Windows Authentication
*mode*. You can switch the server from running in Windows Authentication
mode to Mixed mode - but in either case Windows authenticated users can
still be granted access to the server. In other words, you get either
Windows or Windows + SQL Server doing all the authenticating; and Windows
authenticated users are always candidates for access to your server. As Dave
correctly pointed out and demonstrated, you CAN deny object access to a user
that authenticate through Windows (e.g., domain users). Just understand that
this ability is independent of the authentication mode the server is running
in. Perhaps somewhere between my responses and his and other responses you
can get what you need : )

If you want to set up some test user in SQL Server (which can simplify
things for initial development purposes), the server will have to be running
in mixed mode.

You are correct in observing that you have to make a choice during
installation.
To set up Mixed Mode security following initial installation, you can
complete the following steps in Enterprise Manager (this is from SQL
Server's Books Online):

1. Expand a server group.

2. Right-click a server, and then click Properties.

3. Click the Security tab.

4. Under Authentication, click SQL Server and Windows.

5. Under Audit level, select the level at which user accesses to Microsoft®
SQL ServerT are recorded in the SQL Server error log:
-None causes no auditing to be performed.
-Success causes only successful login attempts to be audited.
-Failure causes only failed login attempts to be audited.
-All causes successful and failed login attempts to be audited.

I hope this gets you closer to what you need

Jeff - MCDBA

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP12.phx.gbl...
ok but can i change to sql authentication? Since this is the question when I install SQL Server.
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:Oo**************@TK2MSFTNGP11.phx.gbl...
FYI,

I just did a revoke on 'Select' on two tables for aspnet windows user
account
and i can still access them using asp.net

i am connecting to the db using sql authentication....

the moment i set the connection string to be using trusted connection it
fails.

so you i think i was right to an extent when i said one of the options was
to use sql authentication instead of windows authentication for sql server conneciton string

HD

"Jeff S" <Je******@asdf.com> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl...
The message is coming from SQL Server - which does not recognize the

ASPNET
user... so, you need to configure SQL Server to recognize the account.

You have a few options for accomplishing this - all depending on your usage scenario. SQL Server's Books Online has some great documentation on the relevant issues.

You don't have to "remove windows authentication as it stands now" - there is no such thing.

HTH

Jeff - MCDBA

"Matthew Louden" <ma*******@hotmail.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
> I wrote ASP.NET application that access SQL Server database. When I run the
> application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'" > error message.
>
> I then did the following, but still didn't work. Any ideas??
>
> 1. In IIS console, right click the virtual directory
> 2. click directory security tab
> 3. click edit button on anonymous access
> 4. click browse button
> 5. select <COMPUTER_NAME>\ASPNET, and uncheck anonymous access
>
>
>



Nov 18 '05 #6

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

Similar topics

4
by: rrober07 | last post by:
Hello, My Setup is I have a Web Server machine(Devweb01), Database SQL Machine(Devsql01), a Client Machine(local machine) I have configured the SQL machine as follows: 1) Added local Aspnet...
3
by: Maellic | last post by:
Hi, The website I am working on is built with ASP.NET and connects to a SQL Server 2000 database. The web server and database are on the same machine. I have recently tried to modify the timeout...
4
by: Chuck Bowling | last post by:
I'm having a problem that i really don't understand. I'm new to ASP.NET and to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work. I think the problem is permissions but I'm not...
12
by: Michael | last post by:
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...
5
by: Ramtin | last post by:
Hi; when I use sql server connection or ole connection for working with database I receive the login failed for user 'any user that I work'.I've been granted ASPNET user in sql.
10
by: BLUE | last post by:
I'm using SQL Server 2005 Developer Edition on Windows XP SP2 with this setting: <add name="SqlServerTrustedConn" providerName="System.Data.SqlClient" connectionString="Data...
4
by: RN1 | last post by:
I am working on WinXP Pro SP3, .NET 2.0 & SQL Server 2005 (Windows Authentication). When I run a ASPX page that connects to SQL Server, the following error gets generated: Login failed for user...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.