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

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.
 
C

Curt_C [MVP]

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top