Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Login failed

Author  Topic 

parrot
Posting Yak Master

132 Posts

Posted - 2008-07-06 : 01:31:10
I keep getting a Login failed for user 'XP\ASPNET' on my web page when I attempt to open an SQL database. I do not get this message during testing in Visual Studio 2005. However, when I install it on another computer I get this message. I have added about 4 other users including XP\ASPNET in the Users portion of the database under Administration Tools/Computer Management. I need to resolve this by Monday as I have a demo scheduled for then. Help anyone!!!
Dave

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-06 : 13:23:09
Did you add it in sql as sql login?
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-07-06 : 15:03:29
What I don't understand is that my initial web program opened the database ok but when I pass control to the next page, I get the open error on the same database using the same open parameters. Again it only happens outside the development environment.
Dave
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-06 : 18:19:13
May because your web app runs under different windows account.
Go to Top of Page

maninder
Posting Yak Master

100 Posts

Posted - 2008-07-06 : 19:16:21
The user should be added into the Database itself using Enterprise Manager or SQL Server Management Studio. This will be under the DatabasesFolder then users. you also need to assign it Proper Permissions typically Db_Owner.

Maninder
SQL server Architect / Admin (DEV&PROD)
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-07-06 : 22:04:11
I am able to get into this same database with other programs and systems on the same computer. Why would I need to add the user name again to the database as it is already there? Is this access denied due to the fact that these programs are located in a different directory. I updated IIS to make the directory a web application so I don't what else I can do
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-06 : 23:21:12
You sure they use same sql login id? They access same db on the server? It's nothing to do with app's file directory.
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-07-06 : 23:33:21
The two different programs in 2 different web applications use the same connection as shown here:
strConn = "Provider=SQLOLEDB; Data Source=" + server.Text + "; Initial Catalog=" + dbname.Text + ";Integrated Security=SSPI";

The user login id is the same in both systems. Both web.config uses Windows authentication so I don't see how the login id has anything to do with. What are you referring to when you say "sql login id". The only other difference in the 2 systems is that the one that works uses IIS server whereas the one that doesn't work uses the Windows Studio 2005 server. Again, I must mention that I do not get the error when I run the program in Visual Studio 2005, only when I run it by itself as a stand alone web page. That has to be some kind of clue. It tells me that the environment is causing the problem and not the program coding or passwords. This is really frustrating as I am been programming my brains out only to be stymied by something that should be so simple yet is driving me nuts. In my opinion, the security problems in Visual Studio and SQL Server are a big pain in the butt and bring my programming efficiency down to zero.
Dave
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-06 : 23:52:51
quote:
Originally posted by maninder

you also need to assign it Proper Permissions typically Db_Owner.




This is bad advice for security reasons. A good DBA provides only the permissions that are required by the application and not a single permission extra. db_owner should be used in rare circumstances.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -