Question

  Asked: May 7 2008   3:24 PM GMT
  Asked by: SQL Server Ask the Experts


Query error when using application role with ADO connection


ERROR MESSAGE, Application development, ADO, SQL Server development, Domain

I am developing an application with an ADO connection. I need to run a query on two different databases on the same server using an application role. When I run the query I get an error \domainusername does not have a logon on database (referring to the second database). Is there any way around it? I have tried to create the same app role in both databases and it did the same.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



You have to have the login mapped into both databases, then the application role must be defined within both databases as well. As you enter each database you need to activate the application role.

The only other option which would be very less than secure would be to enable and use the guest account to get into the database then activate the application role.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development, SQL Server and Networking.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny  |   May 7 2008  6:37PM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.