Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXECUTE permission denied on object 'sp_OACreate'

Status
Not open for further replies.

arst06d

Programmer
Nov 29, 2002
324
Hi
I have a user executed stored procedure which in turn calls the sp_OACreate extended stored procedure in Master database, in order to run a DTS Package.

CREATE PROCEDURE usp_AIP2AS400

@strExperianRef char(26),
@strErrDesc varchar(1000) OUT

AS

--Local Variables --
Declare @PckgName VarChar(255)
Declare @Server varchar(255)
Declare @userName varchar(255)
Declare @pwd varchar(255)
Declare @hPkg int
Declare @hResult int
Declare @Method varchar(30)
Declare @lFlags int

Declare @src varchar(40)
declare @src2 int
Declare @desc varchar(200)


--Define the package --
Set @PckgName = 'AIP3'
Set @Server = '(local)'
Set @username = ''
Set @pwd = ''
Set @lFlags = 256 -- 256=Trusted, 0=SQL Server Security

--Create the Package object --
EXEC @hResult = sp_OACreate 'DTS.Package2', @hPKG Out
If @hResult <> 0
Begin
Exec sp_OAGetErrorInfo NULL, @src OUT, @desc OUT
Select @strErrDesc = 'Error Creating DTS Package: ' + @desc
Return @hResult
End
--Select 'Done Step 1'

Now as I understand it, the users need only have EXEC permissions to this topmost sp, the creation of the DTS object etc being done under the context of the SQLAgent. Pls correct me if I'm wrong.

Now, here's the problem. On our Development and UAT machines this works fine - DTS package is run and returns data. On LIVE, however, it fails with &quot;EXECUTE permission denied on object 'sp_OACreate' &quot;.

Now here's a weirder problem: Up until a month ago this was working fine. Security patches were installed & now it doesn't. Same patches were installed on Dev & UAT & they are working fine.

As far as I can see the SQLAgent context has sufficient permissions, and database permissions are the same across 3 environments. I did read something about Cross-Database Ownership, but the settings are the same on all machines.

Help!
 
Sorry - forgot to mention we're running sql2000 on win2K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top