how to give proper permission for asp.net in sql server express

  • Thread starter Thread starter Chen Xiyang
  • Start date Start date
C

Chen Xiyang

hi,

i have a problem which bothered me for a long time. i tried to connect
my asp.net page with sql server express 2005 and always got some error
msg telling that the current nt account doen't have enough permission.

i know this happens because i havn't given proper permission to the
internet guest account. i tried the following sql statements in visual
studio, but no one worked:

sp_grantlogin 'machine_name\ASPNET'
sp_grantlogin 'IUSR_MACHINE_NAME'
sp_grantdbaccess 'machine_name\ASPNET', 'Common User'
sp_grantdbaccess 'machine_name\ASPNET', 'DBO'
sp_grantdbaccess 'IUSR_MACHINE_NAME', 'Common User'
sp_grantdbaccess 'IUSR_MACHINE_NAME', 'DBO'
.......

besides the problem, now i begin to be messed up with those sql server
permission stuff. anyone can help to figure it out? or is there any
article that can help me have a better understanding of that?

thanks.
 
It may be easier to change the IIS user to one that has permission, but in
anycase double check IIS, to make sure you are getting the right username.
Also, is SQL2k5 on the same box? is it a domain member? you may need to
specify that if it is.
 
You have granted login and db access but you don't say if you have granted
permissions to the tables/views/stored procedures (GRANT ALL PRIVILEGES ON
object_name TO user_name)

You could also add a new SQL user to the database (don't forget to grant
permissions) and specify that on the connection string.

Chris.
 
Back
Top