Skip to main content

Posts

Showing posts from January, 2016

Setting up a Linked Server login for EasySoft Salesforce ODBC Driver

We're currently using EasySoft's excellent Salesforce ODBC Driver to be able to treat our Salesforce org as if it were another SQL database (really useful for updating legacy stored procedures by rewriting queries that reference migrated Dynamics tables to query Salesforce instead!) We were working on updating a particular page in our website that needed to use it but was running into permissions issues when querying it, the error was:

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

For future reference, this means that the account the website was connecting with wasn't granted permission to connect to the ODBC driver since it's set up as a "Linked Server", and SQL server doesn't just let you query those unless you've got sysadmin privileges, or unless the account is specifically set up to connect to them. Here's the code I used to resolve the issue:

--removing previous login, because I had to tweak this a few times exec sp_d…