Senin, 16 September 2013

[MS_AccessPros] RE: Users Executing Stored Procedure With OWNER Access

 

Darrell


As far as I know, you have to grant all users permission to run the sp. I ran into that years ago. I was the only one who ran a procedure that did some data import and manipulation so I never thought about permissions (I was the sysadmin). Then one day one of my users took on the task and it wouldn't run. Duh!


By using OWNER, you don't have to give permissions to the objects referenced such as individual tables.


Regards,

Bill Mosca, Founder - MS_Access_Professionals

http://www.thatlldoit.com

Microsoft Office Access MVP

https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E

My nothing-to-do-with-Access blog

http://wrmosca.wordpress.com




--- In MS_Access_Professionals@yahoogroups.com, <ms_access_professionals@yahoogroups.com> wrote:

Greetings All,

 

I have the following stored procedure:

 

CREATE PROCEDURE [dbo].[usp_NewScriptPwd]

      -- Add the parameters for the stored procedure here

      @ScrUser varchar(6),

      @EncPwd varchar(8),

      @ModBy      varchar(10),

      @EncKey varchar(16)

 

      WITH EXECUTE AS OWNER,

            RECOMPILE

 

AS

 

BEGIN

 

    -- Insert statements for procedure here

      INSERT INTO dbo.tblScriptConfigNASCO(ScriptingID, ScriptingPassword, ChangeUser, PassKey)

      VALUES(@ScrUser, dbo.fnEncDecRc4(@EncKey, @EncPwd), @ModBy, @EncKey)

 

END

 

Must I still GRANT EXECUTE to the users that will be running code that calls this stored procedure?

 

Darrell

 


The information contained in this communication is highly confidential and is intended solely for the use of the individual(s) to whom this communication is directed. If you are not the intended recipient, you are hereby notified that any viewing, copying, disclosure or distribution of this information is prohibited. Please notify the sender, by electronic mail or telephone, of any unintended receipt and delete the original message without making any copies.

Blue Cross Blue Shield of Michigan and Blue Care Network of Michigan are nonprofit corporations and independent licensees of the Blue Cross and Blue Shield Association.

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
.

__,_._,___

Tidak ada komentar:

Posting Komentar