Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > login failed for user

Reply
Thread Tools

login failed for user

 
 
Middletree
Guest
Posts: n/a
 
      02-17-2008
I'm pulling my hair out.

I am trying to set up a website on my home PC for development there. I have
been using my laptop, but want to move it to the desktop.
Both machines are running Windows XP Pro SP2.
Both have SQL Server 2005 standard.

This site works fine in Production, by the way, which is hosted by company
that I am paying monthly.

All I am doing is trying to move the development version of this site from
one machine to another, but I am getting this error:

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'asp'. The user is not associated with a trusted SQL
Server connection.
/shape/includes/shapedbinc.asp, line 33


Here is the connection string, which is kept in an include file:
strDBConnection ="Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=asp;Password=xxx;Initial Catalog=SHAPE;Data Source=LUSR0594"

set conn = CreateObject("ADODB.Connection")

conn.open strDBConnection

====================================

Of course, I changed the password for this post. The machine name, which is
also the SQL Server instance name, got changed from LUSR0594 (on the machine
that works) to "HOME" for the desktop. I am sure that this information is
correct.

I have researched the heck out of this, and spent a lot of time at
aspfaq.com, particularly
http://databases.aspfaq.com/database...look-like.html
and all suggestions offered are not resolving my particular issue. I have
also been to every link on that page, including KB articles.

I have the computers side by side, comparing settings in the database
itself, and can only find one difference:

In SQL Server Management Studio, I go to the Security navigation tab on the
left. It's the one outside of the list of databases. I expand Security to
Logins, and expand that. I right-click "asp" and go to Properties. On the
left, I highlight User Mapping. On the machine that works, the database
which I use (called "SHAPE") has "asp" in the User column, and db_owner
under default schema.

In the same section on the machine which doesn't work, nothing is in those
columns for that database. Obviously, I tried adding asp and db_owner in
those two respective spots, and cannot get it to save my changes. Mgmt
Studio tells me "User, group, or role 'asp' already exists in the current
database."

I am at a loss and losing tons of valuable time on this. I am not sure what
I need to do.

Any help appreciated. Thanks.






 
Reply With Quote
 
 
 
 
Jeff Dillon
Guest
Posts: n/a
 
      02-18-2008
Try launching SQL Management Studio using the "asp" login, and see what
happens

Jeff

"Middletree" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm pulling my hair out.
>
> I am trying to set up a website on my home PC for development there. I
> have been using my laptop, but want to move it to the desktop.
> Both machines are running Windows XP Pro SP2.
> Both have SQL Server 2005 standard.
>
> This site works fine in Production, by the way, which is hosted by company
> that I am paying monthly.
>
> All I am doing is trying to move the development version of this site from
> one machine to another, but I am getting this error:
>
> Error Type:
> Microsoft OLE DB Provider for SQL Server (0x80004005)
> Login failed for user 'asp'. The user is not associated with a trusted SQL
> Server connection.
> /shape/includes/shapedbinc.asp, line 33
>
>
> Here is the connection string, which is kept in an include file:
> strDBConnection ="Provider=SQLOLEDB.1;Persist Security Info=False;User
> ID=asp;Password=xxx;Initial Catalog=SHAPE;Data Source=LUSR0594"
>
> set conn = CreateObject("ADODB.Connection")
>
> conn.open strDBConnection
>
> ====================================
>
> Of course, I changed the password for this post. The machine name, which
> is also the SQL Server instance name, got changed from LUSR0594 (on the
> machine that works) to "HOME" for the desktop. I am sure that this
> information is correct.
>
> I have researched the heck out of this, and spent a lot of time at
> aspfaq.com, particularly
> http://databases.aspfaq.com/database...look-like.html
> and all suggestions offered are not resolving my particular issue. I have
> also been to every link on that page, including KB articles.
>
> I have the computers side by side, comparing settings in the database
> itself, and can only find one difference:
>
> In SQL Server Management Studio, I go to the Security navigation tab on
> the left. It's the one outside of the list of databases. I expand Security
> to Logins, and expand that. I right-click "asp" and go to Properties. On
> the left, I highlight User Mapping. On the machine that works, the
> database which I use (called "SHAPE") has "asp" in the User column, and
> db_owner under default schema.
>
> In the same section on the machine which doesn't work, nothing is in those
> columns for that database. Obviously, I tried adding asp and db_owner in
> those two respective spots, and cannot get it to save my changes. Mgmt
> Studio tells me "User, group, or role 'asp' already exists in the current
> database."
>
> I am at a loss and losing tons of valuable time on this. I am not sure
> what I need to do.
>
> Any help appreciated. Thanks.
>
>
>
>
>
>



 
Reply With Quote
 
 
 
 
Middletree
Guest
Posts: n/a
 
      02-18-2008
> Try launching SQL Management Studio using the "asp" login, and see what
> happens
>


On my good computer, it works fine. I will try the other one when I get
home.

What should I look for?


 
Reply With Quote
 
Jeff Dillon
Guest
Posts: n/a
 
      02-18-2008
"Access Denied" when you try to log in and access that database.

"Middletree" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> Try launching SQL Management Studio using the "asp" login, and see what
>> happens
>>

>
> On my good computer, it works fine. I will try the other one when I get
> home.
>
> What should I look for?
>



 
Reply With Quote
 
Jeff Dillon
Guest
Posts: n/a
 
      02-18-2008
And you need to specify the correct computer name "Home", right?

"Middletree" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> Try launching SQL Management Studio using the "asp" login, and see what
>> happens
>>

>
> On my good computer, it works fine. I will try the other one when I get
> home.
>
> What should I look for?
>



 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      02-18-2008
Middletree wrote:
> In SQL Server Management Studio, I go to the Security navigation tab
> on the left. It's the one outside of the list of databases. I expand
> Security to Logins, and expand that. I right-click "asp" and go to
> Properties. On the left, I highlight User Mapping. On the machine
> that works, the database which I use (called "SHAPE") has "asp" in
> the User column, and db_owner under default schema.
>
> In the same section on the machine which doesn't work, nothing is in
> those columns for that database. Obviously, I tried adding asp and
> db_owner in those two respective spots, and cannot get it to save my
> changes. Mgmt Studio tells me "User, group, or role 'asp' already
> exists in the current database."


It sounds like you copied the DB -- perhaps by restoring from backup. In
that case, the SQL Server logins are not really synchronized by their
internal IDs. You can remove them from the DB and re-create them, or fix
them with sp_change_users_login:

http://msdn2.microsoft.com/en-us/library/ms174378.aspx

I would look at the Auto_Fix argument.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


 
Reply With Quote
 
Middletree
Guest
Posts: n/a
 
      02-18-2008
> And you need to specify the correct computer name "Home", right?

On this laptop, I didn't have to. I'll let you know what happens at home, on
the computer I am having problems with.

I should note that many of the KBs and articles said that I need to specify
a domain, but my home PC isn't on a domain. I put the computer name, of
course, but still got the problem.


 
Reply With Quote
 
Middletree
Guest
Posts: n/a
 
      02-18-2008
>
> It sounds like you copied the DB -- perhaps by restoring from backup.


Actually, I did a detach, reattach. Probably the same result, though.

>In that case, the SQL Server logins are not really synchronized by their
>internal IDs. You can remove them from the DB and re-create them, or fix
>them with sp_change_users_login:
>
> http://msdn2.microsoft.com/en-us/library/ms174378.aspx
>
> I would look at the Auto_Fix argument.
>


I'll check it out, thanks.


 
Reply With Quote
 
Middletree
Guest
Posts: n/a
 
      02-25-2008
> It sounds like you copied the DB -- perhaps by restoring from backup. In
> that case, the SQL Server logins are not really synchronized by their
> internal IDs. You can remove them from the DB and re-create them, or fix
> them with sp_change_users_login:
>
> http://msdn2.microsoft.com/en-us/library/ms174378.aspx
>
> I would look at the Auto_Fix argument.


I don't know if you are still looking at this old thread, but I am confused
by this link. It didn't make sense to me, a non-expert when it comes to SQL
Server. I just didn't understand it.

Regarding your first paragraph, I tried removing the user and login (why do
those two things have to be separate, anyway?) and putting new ones in, but
got all kinds of errors there, too. This is beyond ridiculous. I've wasted
way too many hours on this.


 
Reply With Quote
 
Middletree
Guest
Posts: n/a
 
      02-26-2008
> You can use sp_change_users_login to patch things up. Otherwise, clean out
> the users (and their schemas, if necessary) in the new database, create
> the logins on the server, assign them to the database and grant the
> appropriate privileges.


I will try this. I was afraid I wouldn't be able to log into SQL Server if I
deleted all logins, but I guess we'll find out.


 
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
Error:Login failed for user ''. The user is not associated with a trusted SQL Server connection. CFTK ASP .Net 5 01-09-2007 10:51 AM
Login failed for user ''. The user is not associated with a trusted SQL Server connection. Dennis ASP .Net 0 06-26-2006 03:55 PM
Login failed for user ''. The user is not associated with a truste =?Utf-8?B?U3lsdmFu?= ASP .Net 4 11-26-2005 04:35 AM



Advertisments