无法从 SQL Server 2008(在 Windows 2008 Server x64 上)调用 RICHTEXT.RichtextCtrl [英] Cannot call RICHTEXT.RichtextCtrl from SQL Server 2008 (on Windows 2008 Server x64)

查看:30
本文介绍了无法从 SQL Server 2008(在 Windows 2008 Server x64 上)调用 RICHTEXT.RichtextCtrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 SQL-Server 中使用休闲功能:

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

问题是,我总是从函数中得到 NULL.它不能创建 RICHTEXT.RichtextCtrl-Object.我认为,问题是,这是一个 x64 服务器.有人知道我如何解决这个问题吗?

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?

我已经成功了:

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

启用 OLE.

推荐答案

我以前使用 CLR 存储过程做过类似的事情.这是您的选择吗?

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

这篇关于无法从 SQL Server 2008(在 Windows 2008 Server x64 上)调用 RICHTEXT.RichtextCtrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆