Login Failed

R

RN1

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 'RON\ASPNET'

where RON is my machine name. I came across a few posts which
suggested adding RON\ASPNET as a User in SQL Server Management Studio
Express (under Security--->Logins node). I did so but that didn't
resolve the problem.

Can someone please advice me how do I overcome this problem?

BTW, is Windows Authentication more secure or SQL Server
Authentication? Under what circumstances should one be preferred over
the other?

Thanks.
 
E

Eliyahu Goldin

Are you sure you specified Windows authentication in your connection string?

Windows Authentication is more secure for an obvious reason that you don't
need to store and to pass the password.

You may also consider impersonating the ASPNET account as some other
account. It may help you in troubleshooting.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
J

Juan T. Llibre

re:
!> the following error gets generated:
!> Login failed for user 'RON\ASPNET'
!> where RON is my machine name. I came across a few posts which

You need to add RON\ASPNET as a login to SQL Server 2005
and specify that login as a user of your database.

re:
!> I came across a few posts which suggested adding RON\ASPNET as a User
!> in SQL Server Management Studio Express (under Security--->Logins node).
!> I did so but that didn't resolve the problem.

Adding the login is not enough.
You must also add the login name to the users for your database.

re:
!> BTW, is Windows Authentication more secure or SQL Server Authentication?
!> Under what circumstances should one be preferred over the other?

I prefer to use SQL Server authentication.
That way, I can use an ad-hoc user to authenticate.

Ymmv...
 
R

RN1

re:
!> the following error gets generated:
!> Login failed for user 'RON\ASPNET'
!> where RON is my machine name. I came across a few posts which

You need to add RON\ASPNET as a login to SQL Server 2005
and specify that login as a user of your database.

re:
!> I came across a few posts which suggested adding RON\ASPNET as a User
!> in SQL Server Management Studio Express (under Security--->Logins node).
!> I did so but that didn't resolve the problem.

Adding the login is not enough.
You must also add the login name to the users for your database.

re:
!> BTW, is Windows Authentication more secure or SQL Server Authentication?
!> Under what circumstances should one be preferred over the other?

I prefer to use SQL Server authentication.
That way, I can use an ad-hoc user to authenticate.

Ymmv...












- Show quoted text -

Thanks friends for your suggestions.

Yes...yes...that's where I was erring. I didn't add the login name to
the users for the database. After adding that login, I can now connect
& retrieve data from the database.

Thanks once again,

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top