Re: attaching SQL Server 2005 Express database in ASP.NET web application



attach databases requires admin permission. this is due to security, if any
user could attach/detach, they access any database on the hard drive.

your best bet if to suppy an admin page, that does the attach, then grats
access to the asp.net process.

-- bruce (sqlwork.com)




"Loane Sharp" <look_sharp_not@xxxxxxxxxxx> wrote in message
news:ugvHUr00FHA.904@xxxxxxxxxxxxxxxxxxxxxxx
> Hi there
>
> Please help! I'm at my wits' end...
>
> I am using the System.Data.SQLClient namespace in an ASP.NET web
> application
> to connect to a local instance of SQL Server 2005 Express.
>
> Using "AttachDBFileName" in the connection string to attach to the
> database,
> I can connect to the database if the ASPNET account is explicitly (a)
> granted database access and (b) given "SELECT" permission, presumably
> because the ASPNET account has limited permission by default.
>
> I'm certain that I'm dealing with a permission issue: If I assign the
> ASPNET
> account to the Administrators group, I can attach to and access the
> database, but this is too scary for me (not to mention for my principals).
> I've been told that I can let the ASPNET account impersonate the local
> user,
> but the local user will not have been given explicit permission to access
> the database (I'm using XCopy deployment with no knowledge of the ultimate
> user's Windows domain\user details). Alternatively I've been told that I
> can
> get the ASPNET process to run under the System account, but (i) this is
> fairly risky too, (ii) I don't know how to do it, and (iii) I'm uncertain
> whether it would work.
>
> Am I missing something glaring?!!
>
> Please help!
>
> Best regards
> Loane
>
>
>


.



Relevant Pages

  • Re: ADO.NET help - Filling a DataGrid with contents of a DataSet
    ... This happens because ASPNET, ... have access permission to the database you are using. ... Select New Login, browser for ASPNET account. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: low permission cannot convert from A97 to A2000/2003
    ... Delete is a separate permission. ... You need open exclusive permission on the database to ... > The admin user has full privileges. ... > as we wont be importing those files from them, and the contractor will be ...
    (microsoft.public.access.security)
  • Re: Setting AllowBypassKey Property
    ... As long as I open the DB with shift pressed, the app stays in Design mode. ... "Bob Bonta" wrote: ... not tested on v97 database. ... I don't see an option in this reply form to attach a file ... ...
    (microsoft.public.access.modulesdaovba)
  • Re: low permission cannot convert from A97 to A2000/2003
    ... Delete is a separate permission. ... You need open exclusive permission on the database to ... > The admin user has full privileges. ... > as we wont be importing those files from them, and the contractor will be ...
    (microsoft.public.access.conversion)
  • Could not Lock File error
    ... >I'm trying to share an access database with an entire ... >modifying this file with FULL PERMISSION on the parent ... >or not AND ONLY allowing one person to modify it's ... It's called an .LDB file, ...
    (microsoft.public.access.security)