Link to home
Create AccountLog in
Avatar of ChiBella
ChiBella

asked on

ASP.NET Deployment for Membership Role Management WebSite Database Errors

Hi,

I have a website using Membership/Role Management that works well in VS2008 but deployed within IIS, generating sql database connection errors.

The first after login was...
Cannot open database "dbasename" requested by the login. The login failed.
Login failed for user 'computername\ASPNET'.

I then added the computername to permissions within the database...
C:\>osql -E -S
1> exec sp_grantlogin 'computername\ASPNET'
2> GO
1> USE databasename
2> GO
1> EXEC SP_GRANTDBACCESS 'computername\ASPNET'
2> GO
1> EXIT

and now I'm getting this error:

EXECUTE permission denied on object 'aspnet_CheckSchemaVersion', database 'databasename', schema 'dbo'.

Can someone tell me what I need to do to get aspnet access to the database within IIS?

Thanks!

Avatar of jorge_toriz
jorge_toriz
Flag of Mexico image

Check all the roles that are added on your database (enrole aspnet in all the roles with the "aspnet_" prefix)
Avatar of ChiBella
ChiBella

ASKER

I did as you stated and got farther, but then ran into table security (permission) errors. I then attempted to grant aspnet table level access but this did not work at all.

Is it better to create a trusted account login/pwd for an application with role membership than to use windows authentication?  If you create an application login account, will all managed users get access to whatever the trusted account has access to?
Also do you need to run aspnet_regsql.exe on the database you are deploying to or can you simply backup/restore on the deployment server?
ASKER CERTIFIED SOLUTION
Avatar of jorge_toriz
jorge_toriz
Flag of Mexico image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thank you! Just what I needed.

I did set it up under an explicit login and that fixed everything. I granted db_owner...will change that to db_datareader role.