Friday, February 24, 2012

EXECUTE permission denied on object Test, database DI, owner dbo

hi,
I use DataGrid in name UserTable.
I use this code:

SqlCon.Open()

UserTable.DataSource = SqlCom.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

UserTable.DataBind()

and i get this error:EXECUTE permission denied on object 'Test', database 'DI', owner 'dbo'
I craete stored prcedure in name Test with the simple SQL code:
CREATE PROCEDURE [dbo].[Test] AS
select Users.*
from Users
GO

If instead i put the SQL code :select Users.* from Users
in my command as a text i get the error :SELECT permission denied on object 'Users', database 'DI', owner 'dbo'

i have already create a local premmision for my DB & tables as MYMACHINE/ASPNET

How i can solve this problem?
Thanks, Moshe

It is definatly a database permissions issue. A quick and dirty fix is to give the aspnet account database owner permissions to the database DI, this is not recommended for a release version of the application.

With SPROCS what you need to do (if the account isnt in the owner group of sql) then you need to specify that the account has execute permissions for each sproc.

This can be achieved by going into enterprise manager, finding said sproc, right clicking on it, goto permissions (i think) and add the correct user to execute.

Hope this helps,

Andrew

|||There are two permissions in SQL Server you may have created the database permissions by right click on user in the database, now go to the Security section in Enterprise Manager and Create the Server login. Hope this helps.

No comments:

Post a Comment