Tuesday, March 6, 2012

.NET Assembly, sql 2005 + sp_oaCreate

I've got an assembly (in house, writen in c# 1.1 framework) that I've gotten
to work under SQL 2000, but I've I can't get it to work under 2005.
Steps I've done to get setup:
Step 1: Register the assemblies
Regasm e.core.dll
Regasm rrproxy.dll
Step 2: Add them to the GAC:
Add the assemblies:
RRProxy.dll then
e.core.dll
TSQL Code: (works on 2000, not 2005).
DECLARE @.src varchar(255), @.desc varchar(255)
declare @.hr int, @.rpmobj int,@.RetVal int
exec @.hr = Sp_OACREATE 'RRProxy.Request', @.rpmobj OUTPUT
IF @.hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @.rpmobj, @.src OUT, @.desc OUT
SELECT hr=convert(varbinary(4),@.hr), Source=@.src, Description=@.desc
RETURN
END
exec SP_OADestroy @.rpmobj
Results: ---
Hr: Source:
Desc:
0x80131700 ODSOLE Extended Procedure NULL"examnotes" <RonWest@.discussions.microsoft.com> wrote in
news:3F1299D9-EE23-4146-BB90-100A17F1B2BD@.microsoft.com:

> I've got an assembly (in house, writen in c# 1.1 framework) that I've
> gotten to work under SQL 2000, but I've I can't get it to work under
> 2005.
>
Have you explicitly allowed sp_OAxxx to be run. They are disabled by
default. You have to configure it either through sp_configure or by the
Surface Area Confisuration (SAC) tool.
Also, wouldn't it be better to re-compile your dll's with CLR 2.0 and run
them natively as SQLCLR assemblies?
Niels|||Yes, sp_oa has been enabled on this machine. Other COM based components work
without issue.
I has considered the CLR implementation, but the objects would need to be
re-writen due to the multiple properties/method implentations.
I'd even considered a CLR wrapper to this assembly, but I've been unable to
create the external reference from with a class of the type stored procedure
.

No comments:

Post a Comment