dbTalk Databases Forums  

Calling a .net assembly from a ActiveX script Task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Calling a .net assembly from a ActiveX script Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cammie Watson
 
Posts: n/a

Default Calling a .net assembly from a ActiveX script Task - 11-05-2004 , 03:58 AM






Hi there,

I have some DTS routines which run overnight doing some calculating and some
flattening of data and form a Data Warehouse Database. We are currently
moving the routines from SQL7 to SQL2000 on another server. Now, one of the
DTS tasks is an ActiveX Script task which calls 2 methods in a vb6 dll, and
as part of the move I have rewritten the vb6 dll to a c# assembly.
Unfortunately, I can no longer call the new .NET assembly, I keep getting an
"ActiveX cannot create object" error. I've made my c# assembly with COM
interop and can call it from a vb6 application and it runs OK, but as soon as
I use 'CreateObject("WarehouseDTS.Routines")' I get the activeX error.

Can anyone help? Will I have to wait for SQL2005 before I can call .NET
assemblies directly (No COM Interop)?



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Calling a .net assembly from a ActiveX script Task - 11-08-2004 , 02:20 AM






If you have created a CCW then this should work. The error says that the CCW
is not registered correctly, same error you get when a regular COM DLL is
not registered correctly. Have you installed in correctly on the same
machine as the DTS package is being run, remembering DTS is all client side
COM itself.

--
Darren Green
http://www.sqldts.com

"Cammie Watson" <Cammie Watson (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi there,

I have some DTS routines which run overnight doing some calculating and
some
flattening of data and form a Data Warehouse Database. We are currently
moving the routines from SQL7 to SQL2000 on another server. Now, one of
the
DTS tasks is an ActiveX Script task which calls 2 methods in a vb6 dll,
and
as part of the move I have rewritten the vb6 dll to a c# assembly.
Unfortunately, I can no longer call the new .NET assembly, I keep getting
an
"ActiveX cannot create object" error. I've made my c# assembly with COM
interop and can call it from a vb6 application and it runs OK, but as soon
as
I use 'CreateObject("WarehouseDTS.Routines")' I get the activeX error.

Can anyone help? Will I have to wait for SQL2005 before I can call .NET
assemblies directly (No COM Interop)?





Reply With Quote
  #3  
Old   
Cammie Watson
 
Posts: n/a

Default Re: Calling a .net assembly from a ActiveX script Task - 11-08-2004 , 09:09 AM



Hi Darren,

I have registered the DLL on the server. It is certainly something to do
with the CreateObject statement. I created a little test application with 2
buttons on a form, one that called the DLL using
CreateObject("WarehouseDTS.Routines") (just like the ActiveX task will) and
the other button called the DLL using 'Set X = New WareHouseDTS.Routines'.
And the second call works OK. Anyway I have worked around this problem by
creating an intermediate DLL in vb6 which calls the offending dll using the
second statement and then I call the intermediate DLL from the ActiveX script
using CreateObject.

Cheers

Cammie.

"Darren Green" wrote:

Quote:
If you have created a CCW then this should work. The error says that the CCW
is not registered correctly, same error you get when a regular COM DLL is
not registered correctly. Have you installed in correctly on the same
machine as the DTS package is being run, remembering DTS is all client side
COM itself.

--
Darren Green
http://www.sqldts.com

"Cammie Watson" <Cammie Watson (AT) discussions (DOT) microsoft.com> wrote in message
news:1CA71B76-A20E-4EC5-8CAA-F532A07BD9B2 (AT) microsoft (DOT) com...
Hi there,

I have some DTS routines which run overnight doing some calculating and
some
flattening of data and form a Data Warehouse Database. We are currently
moving the routines from SQL7 to SQL2000 on another server. Now, one of
the
DTS tasks is an ActiveX Script task which calls 2 methods in a vb6 dll,
and
as part of the move I have rewritten the vb6 dll to a c# assembly.
Unfortunately, I can no longer call the new .NET assembly, I keep getting
an
"ActiveX cannot create object" error. I've made my c# assembly with COM
interop and can call it from a vb6 application and it runs OK, but as soon
as
I use 'CreateObject("WarehouseDTS.Routines")' I get the activeX error.

Can anyone help? Will I have to wait for SQL2005 before I can call .NET
assemblies directly (No COM Interop)?






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.