Cannot create ActiveX component in ASP.net but it is OK in command prompt vbc

Z

Zhou Jingxiong

Hi

I am using third party COM component which come with an installation
program (.exe file included). The program will be register to registry
automatically upon installation.

There is no problem calling the COM component from VB.net Module from
DOS Command Prompt :

Imports System
Imports Microsoft.VisualBasic

Module Module1
Sub Main()
Try
test()
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try

End Sub

Sub test()
Console.WriteLine("*** Start of Testing COM component")

Dim request As Object = CreateObject("Equx.EquxRequest")
Dim res as String = request.getResult()
Console.WriteLine(res)
End Sub

End Module


From Visual Studio.net, I added Reference to Equx.tlb file
and put Imports Equx, copy+paste test() method
But the same code failed to perform after I to ASP.NET Page_Load

Exception Details: System.Exception: Cannot create ActiveX component.

Source Error: Dim request As Object = CreateObject("Equx.EquxRequest")

If I change the above line to :
Dim request As Equx.EquxRequest = new Equx.EquxRequest
the error says that the factory can not create the object.

I am quite new in COM/VB
Please help...
 
C

Chris Jackson

Check the permissions on this file. With a console application, the
application runs with your user credentials, and they obviously have
permission to use that file. With ASP.NET, the application runs with
different credentials (by default the ASPNET account, which is created when
you install the framework), and if this account doesn't have rights to get
to this file, then it is going to fail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top