• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 56
  • Last Modified:

Errors Executing stored procedure sp_OACreate

I have moved the database from Server 2005 to Server 2012. While running Stored Procedures I get consistent error:
Msg 50000, Level 16, State 1, Procedure sp4_rec_declare_email, Line 77
OLE Automation Error Information
Creating object(lkDeclareDocSrvr.lkDeclare) failure
 Source: ODSOLE Extended Procedure
 Description:  Invalid class string
I have tried to activate OLE Automation Procedures
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;

I enclose the code below

EXEC @vHr = master..sp_OACreate 'lkDeclareDocSrvr.lkDeclare', @vObject OUT, 4
IF @vHr <> 0
BEGIN
      /* instance failed; get error info */
      SET @vOutput = 'OLE Automation Error Information' + Char(13) + 'Creating object(lkDeclareDocSrvr.lkDeclare) failure'

      EXEC @vHr = master..sp_OAGetErrorInfo @vObject, @vSource OUT, @vDescription OUT
      IF @vHr = 0
          SET @vOutput = @vOutput + Char(13) + ' Source: ' + ISNULL(@vSource, '') + Char(13) + ' Description: ' + ISNULL(@vDescription, '')
      ELSE
          SET @vOutput = @vOutput + ' sp_OAGetErrorInfo failed.'
      
      RAISERROR (@vOutput, 16, 1)
      RETURN @LK_ERR_FOR_INNER_USE
END
0
josephdts
Asked:
josephdts
  • 2
  • 2
1 Solution
 
lcohanDatabase AnalystCommented:
Did you ran the DUA before the DB upgrade from SQL 2005 to SQL 2012?
DUA = Database Upgrade Advisor
0
 
josephdtsAuthor Commented:
I have backed up and restored the database. It is supposed to remain in 2005 mode
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
It is supposed to remain in 2005 mode
So you didn't change the compatibility level to SQL Server 2012? This might explain the error.
0
 
lcohanDatabase AnalystCommented:
"I have backed up and restored the database. It is supposed to remain in 2005 mode"

If you backed it up ON the SQL 2005 Server and restored it to the SQL 2012 Server did you noticed the "upgrade" that takes place after restore percent = 100? You cannot prevent that and "It is supposed to remain in 2005 mode" means that ONLY the compatibility level is still 2005 not that the database wasn't brought up to SQL 2012 level. There's no need for me to prove that but if you want to confirm it for yourself try backup that same DB on SQL 2012 and restore it on SQL 2005....will never work!

Anyway, did you ran the DUA = Database Upgrade Advisor ON the SQL 2005 Server? If and only if that comes clean we should start looking at different things on the new SQL 2012 home in my opinion. If not then you have to fix all issues revealed by DUA before using it on SQL 2012.

Good luck!
0
 
josephdtsAuthor Commented:
I got what is going on. I need to register the DLL referred to by the query: lkDeclareDocSrvr.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now