Error : Login failed for user 'MACHINE\ASPNET' :/

M

Mr.KisS

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 the database. But i have this exception :

Login failed for user 'KLEO\ASPNET'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.
Exception Details: System.Data.SqlClient.SqlException:
Login failed for user 'KLEO\ASPNET'.

I have put TOTAL CONTROL to the ASPNET User for the
"wwwroot" folder.

What must i do to resolve this problem? Please say me step
by step since i am a novice in MSSQL & ASP.NET.

Thank your for helping!
 
M

Mark Fitzpatrick

It has nothing to do with the directory permissions within the app. The
problem is, you're using a trusted connection to talk to the SQL server.
That meas that the ASPNet user account is the one logging into the SQL
Server. You either have to use a sql server login and not a trusted login,
or you have to set the ASPNet user to have permissions to log into the SQL
Server by adding the ASPNet account to the list of available SQL Server
users.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
D

Dan Brussee

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 the database. But i have this exception :

Login failed for user 'KLEO\ASPNET'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.
Exception Details: System.Data.SqlClient.SqlException:
Login failed for user 'KLEO\ASPNET'.

I have put TOTAL CONTROL to the ASPNET User for the
"wwwroot" folder.

What must i do to resolve this problem? Please say me step
by step since i am a novice in MSSQL & ASP.NET.

Giving control to a folder (directory) will have little effect on a
SQL Server login issue. ASPNET is using the account KLEO/ASPNET (I
would assume your PC's name is KLEO. I would also assume that this
account does not have rights to the SQL Server. Remember that the
aspnet_wp.exe program that is actually executing the application.
Several options listed below...

Give KLEO/ASPNET rights on the SQL Server box (not recommended)

Change the account that ASP.NET uses for this virtual directory to one
that has rights to the SQL Server box.

Use impersonation set in the Web.config file for the asp application,
referring to an account that has rights to the SQL Server box.
 
M

Mr.KisS

Ok, but i dont know how to change the rights of KLEO\ASPNET
for the SQL Server. How to do? I'm under MS SQL 2005
Express. There isn't an enterprise manager or visual guide.
Have you a command line or something that i could use?

Regards.
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top