Query error when using application role with ADO connection

Tags:
ADO
Application development
Domain
SQL Server development
SQL Server errors
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following