"ASP.NET" error: Access to the remote server is denied because no login-mapping exists

16,179

The login that you connect with to your initial database does not have access to the linked database. Why don't you use the account that the application impersonates to connect to the database in Management Studio, and diagnose the issue that way? If you know the login, just create it in the linked database as well with the required permissions.

If creating a new login on the linked server is not an option, create a mapping. If you read the fine print on the wizard, it says "for logins not defined in the list above, connections will be made" using the current security context. Which means that if you don't define a mapping, it will use the current credentials for the link.

Share:
16,179
Even Mien
Author by

Even Mien

How many licks does it take to understand a regular expression?

Updated on June 27, 2022

Comments

  • Even Mien
    Even Mien almost 2 years

    I'm able to execute a stored procedure which queries a Linked Server directly, but when I call the same sproc though ASP.NET then I get the following error:

    Access to the remote server is denied because no login-mapping exists.

    When I execute it through SSMS, I am connected through my Windows domain account.

    The site is ASP.NET with Forms Authentication on IIS 7 and SQL 2008 on my local machine.

    The Linked Server is set up to "Be made using this security context" for all logins.