Solved

Errors Executing stored procedure sp_OACreate

Posted on 2016-09-12
6
21 Views
Last Modified: 2016-10-30
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
Comment
Question by:josephdts
  • 2
  • 2
6 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 41795092
Did you ran the DUA before the DB upgrade from SQL 2005 to SQL 2012?
DUA = Database Upgrade Advisor
0
 

Author Comment

by:josephdts
ID: 41795183
I have backed up and restored the database. It is supposed to remain in 2005 mode
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 41795516
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
 
LVL 39

Expert Comment

by:lcohan
ID: 41796082
"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
 

Accepted Solution

by:
josephdts earned 0 total points
ID: 41796351
I got what is going on. I need to register the DLL referred to by the query: lkDeclareDocSrvr.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now