Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures'

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.

I tried to enable Ole Automation Procedures as:

sp_configure 'show advanced options', 1   GO  RECONFIGURE;  GO  sp_configure 'Ole Automation Procedures', 1  GO  RECONFIGURE;  GO  sp_configure 'show advanced options', 1  GO  RECONFIGURE; 

When I am executing query, I'm successfully getting output. But when trying through windows forms, I'm getting this error. Please help me

like image 915
FM Plus Avatar asked Jan 20 '15 18:01

FM Plus


People also ask

How do I enable OLE Automation procedures?

By default, SQL Server blocks access to OLE Automation stored procedures because this component is turned off as part of the security configuration for this server. A system administrator can enable access to OLE Automation procedures by using sp_configure.

How do I turn on OLE Automation procedures in SQL Server?

To determine if "Ole Automation Procedures" option is enabled, execute the following query: EXEC SP_CONFIGURE 'show advanced options', '1'; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'Ole Automation Procedures';

What is OLE Automation procedures?

SQL Server “OLE Automation Procedures” enables the SQL Server to leverage OLE to interact with other COM objects. Data security-wise, this increases the attack surface. There are excellent examples out there for leveraging COM objects to perform lateral movement.

Is OLE Automation deprecated?

No version seems to list either "OLE Automation" or "sp_OA", so it would appear that the feature is not officially deprecated. Yes, you heard correctly that the OLE Automation stored procedures are buggy and leaky (or at least have been at various times / service pack levels).


2 Answers

The following example shows how to view the current setting of OLE Automation procedures.

EXEC sp_configure 'Ole Automation Procedures'; GO 

The following example shows how to enable OLE Automation procedures.

sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'Ole Automation Procedures', 1; GO RECONFIGURE; GO 
like image 65
Hadi Salehy Avatar answered Sep 20 '22 08:09

Hadi Salehy


Try to run this 3

sp_configure 'show advanced options', 1  GO  RECONFIGURE;  GO  sp_configure 'Ole Automation Procedures', 1  GO  RECONFIGURE;  GO  sp_configure 'show advanced options', 1  GO  RECONFIGURE; 
like image 25
sansalk Avatar answered Sep 23 '22 08:09

sansalk