'Access denied' when accessing remote SQL Server

Discussion in 'ASP .Net' started by Anton Sokolovsky, Apr 13, 2005.

  1. Hello All,

    Please help. I am completely stuck. Any suggestions are very welcomed.


    I have ASP.NET application that impersonates certain user
    <impersonate="true" userName="registry:..." password="registry:..."/>

    Everythins runs ok on many systems except one: when connecting to database
    (either SQL Authentication or Trused - doesn't matter) the applications
    keeps getting exception :

    Error:
    System.Web.HttpUnhandledException: Exception of type
    System.Web.HttpUnhandledException was thrown. --->
    System.UnauthorizedAccessException: Access is denied.
    at System.EnterpriseServices.Platform.Initialize()
    at System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate
    cb)
    at System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl)
    at
    System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControlctrl,
    IntPtr SID)
    at
    System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
    tionString options, Boolean& isInTransaction)
    at System.Data.SqlClient.SqlConnection.Open()

    Looks like an exception in Resource Pool constructor. What is
    Platform.Initialize() ?

    Code where it fails is rather simple:

    using (SqlConnection sqlConnection = new
    SqlConnection(ConnectionString))
    {
    sqlConnection.Open();
    SqlCommand command = sqlConnection.CreateCommand();
    command.CommandTimeout = defaultFetchTimeout;
    command.CommandText = query;
    command.Transaction =
    sqlConnection.BeginTransaction(IsolationLevel.ReadUncommitted);

    using (SqlDataReader dataReader = command.ExecuteReader())
    {
    while (dataReader.Read())
    {
    //...
    }
    }

    command.Transaction.Commit();
    sqlConnection.Close();
    }

    System is Windows 2000.
    Impersonated user has all rights for registry, it has all rights for my web
    application's folder and for temporary ASP.NET files too. So it is not
    registry or filesystems access problem.
    Changing the solution not to impersonate given user is not an option. SQL
    Server and ASP.NET applications are on different systems.

    I tried reproducing this exception on other systems but without success:
    1. tried stopping MDTC on web server - no success
    2. tried stopping MDTC on sql server system - no success


    Solutions that I found in Internet:
    1. tried using IP adress instead of hostname in connection string - no
    success
    2. tried granting full registry access to the user being impersonated - no
    success


    Thanks in advance,
    Anton.
     
    Anton Sokolovsky, Apr 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    3
    Views:
    3,005
    Kevin Spencer
    Aug 15, 2003
  2. =?Utf-8?B?VmljdG9y?=

    Access to create file on remote server denied

    =?Utf-8?B?VmljdG9y?=, Aug 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    500
    =?Utf-8?B?RnJhbsOnb2lzIExlbWFpcmU=?=
    Aug 16, 2005
  3. Philip
    Replies:
    1
    Views:
    164
    Dominick Baier [DevelopMentor]
    Sep 16, 2005
  4. Wesley Chen
    Replies:
    0
    Views:
    228
    Wesley Chen
    Apr 7, 2009
  5. Wesley Chen
    Replies:
    9
    Views:
    245
    Sean O'Halpin
    Apr 14, 2009
Loading...

Share This Page