Link to home
Start Free TrialLog in
Avatar of josephdts
josephdts

asked on

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
Avatar of lcohan
lcohan
Flag of Canada image

Did you ran the DUA before the DB upgrade from SQL 2005 to SQL 2012?
DUA = Database Upgrade Advisor
Avatar of josephdts
josephdts

ASKER

I have backed up and restored the database. It is supposed to remain in 2005 mode
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.
"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!
ASKER CERTIFIED SOLUTION
Avatar of josephdts
josephdts

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial