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

G

Guest

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
 
P

Paul Clement

¤ 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)
 

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

Top