DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: ActiveX component can't create object

  1. #1
    Join Date
    Jul 2005

    Question ActiveX component can't create object

    I'm getting that old favourite: ActiveX component can't create object.

    I have a WindowsXP SP2 (pre-patched) machine with IIS, VB6, VB.Net2003EE, DotNetSP1 and SQL2000Developer, MDAC2.8 SP1 (verified using the mdac tool).

    Basically it is the same problem as described here: , except I'm not using MTS - these are plain old vb6 com dll's. They recompile just fine, reference each other fine, but when called from asp get the "ActiveX component can't create object" error. Reregistering them doesn't work - but of course they are already registered otherwise VB6 wouldn't show them in its References.

    Their suggestion is to reinstall MDAC, which I know from past experience will fix the problem. But I can't do this because I'm running XP SP2, and the MDAC tool tells me it's installed properly anyway.

    This site has a description on MDAC and SP2: It tells me how to reinstall MDAC 2.8 SP1 and I've followed these instructions but it doesn't fix the aforementioned problem.

    From reading these accounts I thoguht that MDAC might be the culprit. My DLL's all reference ado connections and so on heavily. So I've experimented a bit:

    I've verified that a script (vbs or asp) can access my database by the following VBS script:
    Set conn = CreateObject("ADODB.Connection")
    conn.ConnectionString = "File Name=C:\Documents and Settings\me\Desktop\conn.UDL;"
    conn.ConnectionTimeout = 120
    conn.CommandTimeout = 120
    Set foo = createobject("adodb.recordset")
    sql = "select * from mytable" sql, conn, 1, 3
    do while not foo.eof

    And I get some alerts. Yay, data access works!

    I've built an activex dll in VB6 using the template/wizard which has NO reference other than the standard ones, and added the following code:
    Public Function SayHello() as String
    SayHello = "Hello"
    End Function

    Then to test it from a VBS file:
    set tbD = CreateObject("Project1.Stuff")
    set tbD = nothing

    Which alerts "Hello". So ActiveX is working. I'd be super-surpised if it wasn't.

    Next, I've built an activex dll so that it can response out to the asp response stream. I did this by:

    1. Used VB6 to make a new ActiveX DLL Project
    2. Added References:
    - Microsoft Active Server Pages Object Library
    - Microsoft Scripting Runtime
    3. Added a class called "Stuff" to my project (project1) with the following code

    Private m_Application
    Private m_Request
    Private m_Response
    Private m_Session
    Private m_Server

    Public Sub OnStartPage(objScriptingContext As ScriptingContext)
    Debug.Print "OnStartPage"
    Set m_Application = objScriptingContext.Application
    Set m_Request = objScriptingContext.Request
    Set m_Response = objScriptingContext.Response
    Set m_Session = objScriptingContext.Session
    Set m_Server = objScriptingContext.Server
    End Sub

    Sub StartPage()
    Debug.Print "StartPage"
    End Sub

    Public Sub OnEndPage()
    Debug.Print "OnEndPage"
    Set m_Application = Nothing
    Set m_Request = Nothing
    Set m_Response = Nothing
    Set m_Session = Nothing
    Set m_Server = Nothing
    End Sub

    Private Function Hello(ByVal s As String) As String
    Debug.Print "Hello"
    Hello = "Hello " & s
    End Function

    Public Sub SayHello()
    Debug.Print "SayHello"
    m_Response.Write App.Path & "\" & App.EXEName & " says " & Hello("world")
    End Sub

    Compile, register, create a small asp page which creates and calls the object, and boom: activex can't create the object. I thought it still might be my dll's so I tried out 3rd party ones which work on oher machines, but these result in exacly the same error.

    I've also tried setting explicit permissions for my IUSR_<name> account to have read & execute on my C:\WINDOWS, C:\Program Files\Common Files\System and C:\INETPUB\WWWRoot folders, and manually registered the C:\Program Files\Common Files\System\ado\msado15.dll file just in case. But to no avail.

    ActiveX just seems borked for me for IIS.

    I'm sure i've missed something crucial here but the most obvious things are sometimes the least obvious...

  2. #2
    Join Date
    Aug 2005
    Guajrat, India
    Have you register the ActiveX DLL which you have created in VB. does it show's registed successfully.

    Bhavesh Solanki

  3. #3
    Join Date
    Feb 2009


    HI Bhavesh,
    i have registered the DLL successfully but the error still exists...ActiveX component can't create object.please help me on this.

  4. #4
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Do you know what object is can't create?

  5. #5
    Join Date
    Feb 2009
    Thanks for the quick reply..

    The object is Web Chart component.In my VB project, creating this web chart is not happening and throws the error shown below.

    We're Sorry.
    An error has occurred while processing your request.
    Script: /Report/DevAnalysisProc.asp
    Error: 429
    Description: ActiveX component can't create object
    Source: DevAnalysis:CreateDevAnalChart

  6. #6
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Is it working on your development machine, but not on a user machine?

  7. #7
    Join Date
    Feb 2009


    Hi Hack,
    The 3rd party tool (Web Chart) to create the Charts are not working fine in Development Server but working fine in Production Server.

    so i tried the following methods:
    a) took Dll(of VB project) from prod and registered it in Dev.
    b) Reinstalled IIS in Development Server
    c)Took system Dll which is meant for Webchart component from prod and registered it in Dev.

    none of the methods worked.

    the configurations are as follows..

    Development config:

    1. 1 CPU 3 GHz Xeon processor.
    2. 512 MB RAM.
    3. Windows 2000 OS (32-bit)
    4. IIS 5.0

    production application server configuration is below:

    1. 8 CPU 3.66 GHz Xeon processor.
    2. 8 GB RAM.
    3. Windows 2003 OS (64 bit)
    4. IIS 6.0

    is it something to do with Server Configurations?? i am not getting any idea how to solve this problem.please help me in solving it.

    Thanks in advance .

  8. #8
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    If it isn't working in Development, then how did you develop anything with it?

    I googled "web chart component" and got a whole lot wierd stuff that did me no good.

    Who makes this component? I've never used it, or for that matter, ever heard of it, so anything I could suggest would be pure speculation. I'd like to see what the vendor's web site may have to say on the subject.

  9. #9
    Join Date
    Feb 2009
    Thank you Hack for your help..
    this seems to be a problem with 3rd party tool web chart..
    we had them reinstalled...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center