PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Cannot open database requested in login <DBName>. Login fails.

Reply

Cannot open database requested in login <DBName>. Login fails.

 
Thread Tools Rate Thread
Old 07-02-2006, 07:36 AM   #1
=?Utf-8?B?QUw=?=
Guest
 
Posts: n/a
Default Cannot open database requested in login <DBName>. Login fails.


Hi

I have 1 web service posting data to a SQL server 2000 database and a
separate ASP.NET web site reading data from the same database. Both use the
same SQL user and password to connect to SQL. The web service is windows
authenticated for a single user and has impersonate set to true. (It needs
this for security to a COM component).

When attempting to post data to SQL from the web service I get the following
error:

Cannot open database requested in login <DBName>. Login fails.

The ASP.NET web reports data off the database. It uses anonymous access and
connects with the same SQL user account. The web can access the data without
any problem.

The SQL user has been placed db_owner role of the database.

The NT account has the same name as the SQL account except with the domain
qualifier prepended. ie.

SQL - user1
NT - MYDOMAIN\user1

Does anyone know why the user credentials would consistantly fail on the web
service and consistantly work on the ASP.NET site. Both are hosted on the
same web server (Win2k3).

Thanks in advance
  Reply With Quote
Old 07-02-2006, 03:17 PM   #2
Paul Clement
Guest
 
Posts: n/a
Default Re: Cannot open database requested in login <DBName>. Login fails.

On Mon, 6 Feb 2006 23:36:13 -0800, "AL" <AL@discussions.microsoft.com> wrote:

¤ Hi
¤
¤ I have 1 web service posting data to a SQL server 2000 database and a
¤ separate ASP.NET web site reading data from the same database. Both use the
¤ same SQL user and password to connect to SQL. The web service is windows
¤ authenticated for a single user and has impersonate set to true. (It needs
¤ this for security to a COM component).
¤
¤ When attempting to post data to SQL from the web service I get the following
¤ error:
¤
¤ Cannot open database requested in login <DBName>. Login fails.
¤
¤ The ASP.NET web reports data off the database. It uses anonymous access and
¤ connects with the same SQL user account. The web can access the data without
¤ any problem.
¤
¤ The SQL user has been placed db_owner role of the database.
¤
¤ The NT account has the same name as the SQL account except with the domain
¤ qualifier prepended. ie.
¤
¤ SQL - user1
¤ NT - MYDOMAIN\user1
¤
¤ Does anyone know why the user credentials would consistantly fail on the web
¤ service and consistantly work on the ASP.NET site. Both are hosted on the
¤ same web server (Win2k3).

So if I understand your description correctly, are you using SQL Server authentication all around
and that is reflected in the connection string for both the ASP.NET app and web service?


Paul
~~~~
Microsoft MVP (Visual Basic)
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off