Sunday, February 19, 2012

ASPNET account

I seem to remember that when using VS2003 to create a website which connected to a MSDE database, I needed to explicitly grant access to the database for ASPNET machine account using the following SQL commands from within a .sql script:

EXEC sp_grantlogin '<machine>\ASPNET'
EXEC sp_grantdbaccess '<machine>\ASPNET'

With VS2005, it sppears that upon creating an .MDF database in the App_Data folder this is no longer necessary.

I'd be interested to know why this is so. Does VS2005 automatically do this when the database is created?

If anybody could shed some light on this I'd be interested.

Thanks,
Wayne.

Yes, it's. When you create the web site project the app_data folder already has the correct permision to worker process account. When you create the new mdf or add existing mdf to this folder, it's automatically inherit the permission from app_data folder.

Hope that helps,

Lan

|||

Thank you for your reply.

I think what you are saying relates to NTFS permissions on the file itself and not to the accounts that are able to connect to the database.

Wayne.

No comments:

Post a Comment