Solved

Errors Executing stored procedure sp_OACreate

Posted on 2016-09-12
6
25 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 46

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

912 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

20 Experts available now in Live!

Get 1:1 Help Now