Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access aspnetdb.mdf with user aspnet

Status
Not open for further replies.

bbxrider

Programmer
Sep 23, 2008
18
US
can somebody please help with permissions hell needed to access the vstudio generated db, aspnetdb.mdf by the aspnet user. I have invested over 8 hours into this.

i followed these procedures, and copied the db from the vstudio app_data folder to the IIS app_data folder (and the .ldf)

this app is a vstudio generated login control, it works OK in the vs environment. i get this error after moving the app and the db to IIS, Login failed for user 'myPC\ASPNET'.

this is a testing environment, i need to get this working before I move the app to a production server, where the user will be IIS IUSR_MACHINEID
 
wrong forum.. this should be posted to aspnet..


1st question. Is sqlexpress installed on the server?
2nd q.. what does your connection string look like.

 
1st question. Is sqlexpress installed on the server? yes, that is how the procedures in the post link were done

2nd q.. what does your connection string look like. evidently the connection string is not the problem, see below for solution but here it is anyway
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=C:\Inetpub\ Instance=true"
providerName="System.Data.SqlClient" />

after way too many hours to find the solution, this is one that works anyway, run the script below after user aspnet has been added to the server instance and the db itself, it created. it addes roles permission for aspnet_roles_basicAccess + fullAccess + reportingAccess


use [master]
go
grant connect sql to [pcName\ASPNET]
go
 
bbxrider said:
evidently the connection string is not the problem

Well actually it is since it specifies to use integrated security, so that means the account that the process is running under (ASPNET) needs to be given permission to the database. The way to do that is as you described in your solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top