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!

Microsoft SQL ServerMicrosoft IIS Web Server

Avatar of undefined
Last Comment
ChiBella

8/22/2022 - Mon
jorge_toriz

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

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
jorge_toriz

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
ChiBella

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.

Your help has saved me hundreds of hours of internet surfing.
fblack61