SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Access to the remote server is denied because the
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hodgesp
Starting Member

1 Posts

Posted - 05/11/2010 :  13:45:14  Show Profile  Reply with Quote
Greetings Programs! (remember Tron)

I have a .Net application I am designing in C# .Net. Much of my data I garner from views I created based on tables and views from external datasources, ie other databases on the same local server as my main database and from databases on "Linked Servers".

My database sources are all SQL 2005. I have a couple issues concerning remote access. One I beleive I resolved concerning accessing another database on the same server.

BTW:I Am using SQL Authintication.

I have set up a security paradyme where I use one account "abcUser" in my application to connect to the database and it can only execute stored procedures. I use an "EXECUTE AS" clause to run sql scripts as another user "abcRun" for added security. The account I use has db_datareader and db_datawriter on the main database.

I also graneted the second account, "abcRun" ,db_datareader on another database on the same "Local" server. Made my main database a trusted source, and added the database owner basic access to the external database with "AUTHINTICATE" access.

This fixed my first issue of access an external database on the Local server as my main datasource.

However, I still seem to have an issue with access to data via linked servers. I set up the linked server with a base access account as a fall back but made specific "Local server login to remote server login mappings:"

I added the account I use as the "Execute AS", "abcRun" , to the linked server with ,db_datareader access to the database I am targeting.
I get this error when I attempt to run a query against the linked server datasource:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: ME (^8
-- Create date: 04.5.2010
-- Description: Select data Table records--
-- =============================================
ALTER PROCEDURE [dbo].[spu_dataSelect]
-- Add the parameters for the stored procedure here
@commandString VARCHAR(4000)
--
With Execute As 'abcRun'
AS
BEGIN
SET NOCOUNT ON;
-- Select descr , recid from dbo.contact_types_support
-- EXECUTE AS LOGIN ='abcRun'

Execute(@commandString);
Revert
-------------------------------------------------------
-- Print(@commandString) --debugg line
-------------------------------------------------------
END
[/code]



I am not sure what to do at this point. Any suggestions or help would be appreciated.

  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000