Cannot call RICHTEXT.RichtextCtrl from SQL Server 2008 (on Windows 2008 Server x64)

主宰稳场 提交于 2019-12-24 20:13:52

问题


I want to use the fallowing function in my SQL-Server:

CREATE FUNCTION RTF2TXT(@in varchar(8000)) RETURNS  varchar(8000) AS 
BEGIN

DECLARE @object int
DECLARE @hr int
DECLARE @out varchar(8000)

-- Create an object that points to the SQL Server
EXEC @hr = sp_OACreate 'RICHTEXT.RichtextCtrl', @object OUT
EXEC @hr = sp_OASetProperty @object, 'TextRTF', @in
EXEC @hr = sp_OAGetProperty @object, 'Text', @out OUT
EXEC @hr = sp_OADestroy @object
RETURN @out

END
GO

The Problem is, that I always get NULL from the function. It cannot create the RICHTEXT.RichtextCtrl-Object. I think, the problem is, that this is a x64 Server. Does someone have an Idea how I can solve this?

I have already done successfully:

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

to enable OLE.


回答1:


I have previously done similar things using CLR stored procedures. Is this an option for you?



来源:https://stackoverflow.com/questions/11948461/cannot-call-richtext-richtextctrl-from-sql-server-2008-on-windows-2008-server-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!