Re: Can't connect to SQL (ASPNET account)

From: Mary Chipman (mchip@nomail.please)
Date: 07/08/02


From: Mary Chipman <mchip@nomail.please>
Date: Mon, 08 Jul 2002 09:43:18 -0400


Are you intending to use integrated security or a SQLS login? you have
connection strings which are unclear. Try something like the following
for your connection string if you're using the SqlClient provider:

"Data Source=(local);Initial Catalog=DBName;Integrated Security=SSPI;"

If you've set the processModel attribute in machine.config to
userName="machine", then granting ASPNET a login and permissions in
the database should get you in.

-- Mary
MCW Technologies
http://www.mcwtech.com

On Sun, 7 Jul 2002 18:24:17 -0700, "mm2" <jraahauge@yahoo.com> wrote:

>Hi
>
>I have a problem connecting via ASP.NET to my production
>SQL 2000 Server. The SQL server is on my webserver running
>Win 2000 Server and the Server was locked down before
>installing ASP.NET. I don't have any problems in my test
>environment, but that isn't locked down either.
>I have allowed the ASPNET account access to the directory
>with the webfiles and I have allowed the account select
>access on the database in question. I have tried the
>following connection strings:
>
>("server=localhost;database=xxx;trusted_connection=true;")
>("server=localhost;database=xxx;trusted_connection=yes;")
>("server=127.0.0.1;database=xxxx;uid=xxx;pwd=xxx;")
>("Data Source=
>(local);database=xxx;trusted_connection=yes;")
>("server=(local);database=xxx;User Id=xxx;Password=xxx")
>("server=(local);database=xxx;Trusted_Connection=yes")
>
>
>Here is my error message:
>
>Exception Details: System.UnauthorizedAccessException:
>Access is denied.
>
>Stack Trace:
>
>
>[UnauthorizedAccessException: Access is denied.]
>System.Data.SqlClient.SqlConnection.Open() +761
>ASP.data_aspx.Page_Load() in D:\aspx\data.aspx:8
>System.Web.Util.ArglessEventHandlerDelegateProxy.Callback
>(Object sender, EventArgs e) +10
>System.Web.UI.Control.OnLoad(EventArgs e) +67
>System.Web.UI.Control.LoadRecursive() +29
>System.Web.UI.Page.ProcessRequestMain() +724
>
>I can make it work if I change the user in the
>machine.config file to SYSTEM, but that is not an option
>to me since it would leave my webserver way to vulnerable.
>I don't even understand why some solutions suggest using
>this approach.
>
>Hope somebody can help me.
>



Relevant Pages

  • Re: Deploying a SQL Server App
    ... Generally you don't want to deploy the database files per se (although SQL ... the database to the server. ... >> Instread of using connection strings that are hard coded into your ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: membership, SQLExpress and/or SQLServer
    ... you have to alter the connection strings to match the server's ... SQL location. ... It is easier to set up SQL Server with sql connection strings (not ... change the provider to use SQLServer? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Membership Provider
    ... You need Sql 2005 for dynamic database attachment to the ... following connection strings: ... when i upload it to my remote web host with SQL 2000, ... i use sql server mgmt studio but it wont restore or ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Requires Aliase Name Connect to Named Instance
    ... In my experience you have to put VirtualServerName\Instancename in SQL ... Enterprise manager and connection strings for web pages. ... > I have two Windows 2000 Advanced server cluster servers ... > aliase from a SQL Server client connection. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Named instance, no default instance -> connection problems?
    ... > I have the following problem with deployment of MSDE. ... for the server name. ... Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" ...
    (microsoft.public.sqlserver.msde)