Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Login Failed

Reply
Thread Tools

Login Failed

 
 
RN1
Guest
Posts: n/a
 
      06-23-2008
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.
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-23-2008
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


"RN1" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.



 
Reply With Quote
 
 
 
 
Jonathan Wood
Guest
Posts: n/a
 
      06-23-2008
Sounds like an issue with your connection string. I would study that.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"RN1" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.


 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      06-23-2008
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...



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
======================================
"RN1" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>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.



 
Reply With Quote
 
RN1
Guest
Posts: n/a
 
      06-24-2008
On Jun 23, 10:31*pm, "Juan T. Llibre" <(E-Mail Removed)>
wrote:
> 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...
>
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en espaņol :http://asp.net.do/foros/
> ======================================
>
>
>
> "RN1" <(E-Mail Removed)> wrote in messagenews:(E-Mail Removed)...
> >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.- Hide quoted text -

>
> - Show quoted text -


Thanks friends for your suggestions.

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


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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot open user default database. Login failed. Login failed for user 'HEMPC\ASPNET' Tony Johansson ASP .Net 3 01-02-2010 04:09 PM
Cannot open database requested in login 'HumanResources'. Login failed for user 'companyDomain\BOSIIS$'. Homer ASP .Net 3 09-25-2007 07:45 PM
Cannot open database requested in login "DBName" Login failed for Max ASP .Net Security 0 12-20-2005 11:09 PM
Login Failed: Error 18456: Unable to login to run SP on local serv =?Utf-8?B?Z2FyaWJhbGRp?= ASP .Net 2 02-25-2005 09:17 PM
QueryInterface for interface Excel._Application failed / QueryInterface for interface Word._Application failed SOLUTION Wildepiet ASP .Net 0 06-14-2004 07:28 AM



Advertisments