How to Fix Error : SQL Server blocked access to procedure ‘sys.sp_OACreate’ of component ‘Ole Automation Procedures’ because this component is turned off as part of the security configuration for this server.

Problem :

When I was executing a stored procedure in a SQL Server 2005 Database from my C# application, it gave me an error and here is the result I saw when I was debug it..

ole auto error 2

Image 1 : Exception Message

SQL Server blocked access to procedure ‘sys.sp_OACreate’ of component ‘Ole Automation Procedures’ because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of ‘Ole Automation Procedures’ by using sp_configure. For more information about enabling ‘Ole Automation Procedures’, see “Surface Area Configuration” in SQL Server Books Online.

And also I got below error messages with this error. I did not include all information of that message because it is too long..

SQL Server blocked access to procedure ‘sys.sp_OASetProperty’ of component ‘Ole Automation Procedures’ because this component is turned off as part of the security configuration for this server…
SQL Server blocked access to procedure ‘sys.sp_OAMethod’ of component ‘Ole Automation Procedures’ because this component is turned off as part of the security configuration for this server…
SQL Server blocked access to procedure ‘sys.sp_OADestroy’ of component ‘Ole Automation Procedures’ because this component is turned off as part of the security configuration for this server…

Then I searched solutions to fix this error and I found the solution.

Solution :

According to the message we have to enable the OLE Automation feature in Surface area configuration.

Here are steps to Enable the feature..

0 surface search

Image 2 : Search -> SQL Server Surface Area Configuration in Start menu

1 surface search

Image 3 : Select and click Surface Area Configuration for Features

Then you will enter to another form which contains features. Then Select “OLE Automation”

3 ole uttomation

Image 4 : Select OLE Automation

 

4 enable ole automation

Image 5 : Check the Enable OLE Automation Check box

Then Click “OK”, And Click “Apply”.

But when I click “OK”, I got another error that..

User does not have permission to perform this action.

You don’t have permission to RECONFIGURE statement.

5 enable error

Image 6 : Permission error

To fix this error, I had to give permission to the user..

6 set permissions

Image 7 : Give permission to the user

Then you can apply OLE Automation Feature..

Thanks !

One thought on “How to Fix Error : SQL Server blocked access to procedure ‘sys.sp_OACreate’ of component ‘Ole Automation Procedures’ because this component is turned off as part of the security configuration for this server.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s