440 Automation error / 429 ActiveX component can't create object 
Author Message
 440 Automation error / 429 ActiveX component can't create object

I get the following 3 messages when I execute the code from my ActiveX
component DLL when installing for the first time:

Run Time Error '-2147467259 (80004005)': Method '~' of object '~' failed
Error: 440, ReportDME.Preview; Automation error
Error: 429, ReportDME.Preview, ActiveX component can't create object

I wrote the PowerDME.exe in VB 6.0 which calls the Preview method of my
ReportDME class which is stored in the file ClassDME.dll.
The ReportDME class has the Instancing property set to "5 - MultiUse".  The
ClassDME.dll is compiled with the "Binary Compatibility" option.
I used the Package and Deployment Wizard and it added the ClassDME.dll to
the package just fine - I assume that it regestered.
I developed it on a NT 4.0 machine and get the same error on a NT 4.0
install as well as a Win 95 install.
On the development machine, the the exe runs the class fine from the
development folder but gets that error from the \Package\Support folder.

Any help would be greatly appreciated.

ReportDME Class:
---------------------------------------

Option Explicit

    Public Connection As ADODB.Connection
    Public Driver As String
    Public ReportKey As String
    Public ReportName As String
    Public WordDoc As String

Public Sub Preview()

    On Error GoTo ErrorHandler
    Dim Msg As String, ErrSub As String
    ErrSub = "ReportDME.Preview"

    Dim cmd As New ADODB.Command
    Dim prm As ADODB.Parameter
    Dim rs As New ADODB.Recordset

    Set cmd.ActiveConnection = Connection

    PublicWordDoc = WordDoc

    Select Case ReportName
    Case "CMN"
        cmd.CommandText = "SelRptCMN"
        cmd.CommandType = adCmdStoredProc
        Set prm = cmd.CreateParameter("CustomerID", adInteger, adParamInput,
, CInt(ReportKey))
        cmd.Parameters.Append prm
        rs.Open cmd
        If rs.BOF And rs.EOF Then
            Set cmd = Nothing
            Set rs = Nothing
            Err.Raise 600, , "'" & ReportName & "' Is Empty For Customer #"
& CInt(ReportKey)
        End If
        Load rptCMN
        Set rptCMN.DataControl1.Recordset = rs
        rptCMN.Show vbModal
        Set rptCMN = Nothing
    Case "LabelCus"
        Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
    Case "LabelDoc"
        Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
    Case Else
        Err.Raise 603, , "'" & ReportName & "' is an Invalid ReportName"
    End Select

    Set cmd = Nothing
    Set rs = Nothing

    Exit Sub

ErrorHandler:

    Select Case Err
    Case Else
        Err.Raise Err, , ErrSub & "; " & Error$(Err)
        Exit Sub
        Resume
    End Select

End Sub

PowerDME Module:
---------------------------------------

Public Sub gPrintReport(PassReport As String, PassKey As String, PassDriver
As String)

    On Error GoTo ErrorHandler
    Dim Msg As String, ErrSub As String
    ErrSub = "gPrintReport"

    If PassDriver = "" Then
        MsgBox "ERROR: Report Cannot Be Printed For '" & PassReport & "',
Driver Not Setup", , ErrSub
        Exit Sub
    End If

    Dim rpt As New ReportDME

    Call gOpenConnection("gPrintReport")

    Set rpt.Connection = conn

    rpt.ReportName = PassReport
    rpt.ReportKey = PassKey
    rpt.WordDoc = App.Path & "\" & PassReport & ".doc"
    rpt.Driver = PassDriver

    rpt.Preview

    Set rpt = Nothing

    Exit Sub

ErrorHandler:

    Select Case Err
    Case Else
        Screen.MousePointer = vbDefault
        Msg = "Error: " & Err & ", " & Error$(Err)
        MsgBox Msg, , ErrSub
        Exit Sub
        Resume
    End Select

End Sub



Sun, 31 Mar 2002 03:00:00 GMT  
 440 Automation error / 429 ActiveX component can't create object
You say that you assume that your component is registered.
I suggest that you make sure it is. Since this kind of error
is caused in most cases by an class not being registered.

Denis Gorshkov
Mobi-Sys Software Group Inc.
Have more than 1 VBP to compile? - Try Visual Make
www.mobi-sys.com


Quote:
> I get the following 3 messages when I execute the code from my ActiveX
> component DLL when installing for the first time:

> Run Time Error '-2147467259 (80004005)': Method '~' of object '~' failed
> Error: 440, ReportDME.Preview; Automation error
> Error: 429, ReportDME.Preview, ActiveX component can't create object

> I wrote the PowerDME.exe in VB 6.0 which calls the Preview method of my
> ReportDME class which is stored in the file ClassDME.dll.
> The ReportDME class has the Instancing property set to "5 - MultiUse".
The
> ClassDME.dll is compiled with the "Binary Compatibility" option.
> I used the Package and Deployment Wizard and it added the ClassDME.dll to
> the package just fine - I assume that it regestered.
> I developed it on a NT 4.0 machine and get the same error on a NT 4.0
> install as well as a Win 95 install.
> On the development machine, the the exe runs the class fine from the
> development folder but gets that error from the \Package\Support folder.

> Any help would be greatly appreciated.

> ReportDME Class:
> ---------------------------------------

> Option Explicit

>     Public Connection As ADODB.Connection
>     Public Driver As String
>     Public ReportKey As String
>     Public ReportName As String
>     Public WordDoc As String

> Public Sub Preview()

>     On Error GoTo ErrorHandler
>     Dim Msg As String, ErrSub As String
>     ErrSub = "ReportDME.Preview"

>     Dim cmd As New ADODB.Command
>     Dim prm As ADODB.Parameter
>     Dim rs As New ADODB.Recordset

>     Set cmd.ActiveConnection = Connection

>     PublicWordDoc = WordDoc

>     Select Case ReportName
>     Case "CMN"
>         cmd.CommandText = "SelRptCMN"
>         cmd.CommandType = adCmdStoredProc
>         Set prm = cmd.CreateParameter("CustomerID", adInteger,
adParamInput,
> , CInt(ReportKey))
>         cmd.Parameters.Append prm
>         rs.Open cmd
>         If rs.BOF And rs.EOF Then
>             Set cmd = Nothing
>             Set rs = Nothing
>             Err.Raise 600, , "'" & ReportName & "' Is Empty For Customer
#"
> & CInt(ReportKey)
>         End If
>         Load rptCMN
>         Set rptCMN.DataControl1.Recordset = rs
>         rptCMN.Show vbModal
>         Set rptCMN = Nothing
>     Case "LabelCus"
>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>     Case "LabelDoc"
>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>     Case Else
>         Err.Raise 603, , "'" & ReportName & "' is an Invalid ReportName"
>     End Select

>     Set cmd = Nothing
>     Set rs = Nothing

>     Exit Sub

> ErrorHandler:

>     Select Case Err
>     Case Else
>         Err.Raise Err, , ErrSub & "; " & Error$(Err)
>         Exit Sub
>         Resume
>     End Select

> End Sub

> PowerDME Module:
> ---------------------------------------

> Public Sub gPrintReport(PassReport As String, PassKey As String,
PassDriver
> As String)

>     On Error GoTo ErrorHandler
>     Dim Msg As String, ErrSub As String
>     ErrSub = "gPrintReport"

>     If PassDriver = "" Then
>         MsgBox "ERROR: Report Cannot Be Printed For '" & PassReport & "',
> Driver Not Setup", , ErrSub
>         Exit Sub
>     End If

>     Dim rpt As New ReportDME

>     Call gOpenConnection("gPrintReport")

>     Set rpt.Connection = conn

>     rpt.ReportName = PassReport
>     rpt.ReportKey = PassKey
>     rpt.WordDoc = App.Path & "\" & PassReport & ".doc"
>     rpt.Driver = PassDriver

>     rpt.Preview

>     Set rpt = Nothing

>     Exit Sub

> ErrorHandler:

>     Select Case Err
>     Case Else
>         Screen.MousePointer = vbDefault
>         Msg = "Error: " & Err & ", " & Error$(Err)
>         MsgBox Msg, , ErrSub
>         Exit Sub
>         Resume
>     End Select

> End Sub



Mon, 01 Apr 2002 03:00:00 GMT  
 440 Automation error / 429 ActiveX component can't create object
YES - The DLL file appears to be registered.  Here are the values from
RegEdit:

On the development machine I found it in the following registry entries that
contain "ClassDME":
    HKEY_CLASSES_ROOT\ClassDME.ReportDME
        (Default)  "ClassDME.ReportDME"
    HKEY_CLASSES_ROOT\CLSID\{9BD4ACEF-7F3F-11D3-B19A-00C0F02D0460}
        (Default)  "ClassDME.ReportDME"
        AppID  "{9BD4ACEF-7F3F-11D3-B19A-00C0F02D0460}"
    HKEY_CLASSES_ROOT\CLSID\{9BD4ACEF-7F3F-11D3-B19A-00C0F02D0460}\ProgID
        (Default)  "ClassDME.ReportDME"
    HKEY_CLASSES_ROOT\CLSID\{A331B2A8-8007-11D3-B19A-00C0F02D0460}
        (Default)  "ClassDME.ReportDME"
        AppID  "{A331B2A8-8007-11D3-B19A-00C0F02D0460}"

HKEY_CLASSES_ROOT\CLSID\{A331B2A8-8007-11D3-B19A-00C0F02D0460}\InprocServer3
2
        (Default)  "D:\Micro Systems\PowerDME\ClassDME.dll"
        Threading Model "Apartment"
    HKEY_CLASSES_ROOT\CLSID\{A331B2A8-8007-11D3-B19A-00C0F02D0460}\ProgID
        (Default)  "ClassDME.ReportDME"
    HKEY_CLASSES_ROOT\CLSID\{AC91E650-8004-11D3-B19A-00C0F02D0460}
        (Default)  "ClassDME.ReportDME"
        AppID  "{AC91E650-8004-11D3-B19A-00C0F02D0460}"

HKEY_CLASSES_ROOT\CLSID\{AC91E650-8004-11D3-B19A-00C0F02D0460}\InprocServer3
2
        (Default)  "D:\Micro Systems\PowerDME\ClassDME.dll"
        Threading Model "Apartment"
    HKEY_CLASSES_ROOT\CLSID\{AC91E650-8004-11D3-B19A-00C0F02D0460}\ProgID
        (Default)  "ClassDME.ReportDME"
    HKEY_CLASSES_ROOT\TypeLib\{A331B2A4-8007-11D3-B19A-00C0F02D0460}\5.0
        (Default)  "ClassDME ActiveX DLL for Reporting"

HKEY_CLASSES_ROOT\TypeLib\{A331B2A4-8007-11D3-B19A-00C0F02D0460}\5.0\0\win32
        (Default)  "D:\Micro Systems\PowerDME\ClassDME.dll"

On the NT 4.0 Installed machine I found:
    HKEY_CLASSES_ROOT\ClassDME.ReportDME
        (Default)  "ClassDME.ReportDME"
    HKEY_CLASSES_ROOT\CLSID\{A331B2A8-8007-11D3-B19A-00C0F02D0460}
        (Default)  "ClassDME.ReportDME"

HKEY_CLASSES_ROOT\CLSID\{A331B2A8-8007-11D3-B19A-00C0F02D0460}\InprocServer3
2
        (Default)  "D:\PowerDME\ClassDME.dll"
        Threading Model "Apartment"
    HKEY_CLASSES_ROOT\CLSID\{A331B2A8-8007-11D3-B19A-00C0F02D0460}\ProgID
        (Default)  "ClassDME.ReportDME"
    HKEY_CLASSES_ROOT\TypeLib\{A331B2A4-8007-11D3-B19A-00C0F02D0460}\5.0
        (Default)  "ClassDME ActiveX DLL for Reporting"

HKEY_CLASSES_ROOT\TypeLib\{A331B2A4-8007-11D3-B19A-00C0F02D0460}\5.0\0\win32
        (Default)  "D:\PowerDME\ClassDME.dll"

On that same machine in the install log were these entries based on a search
of "ClassDME":
    ACTION: SharedFile: "D:\PowerDME\ClassDME.dll"
    (File was not found or was an older version -- new file copied)
    ...and
    ACTION: DllSelfRegister: "D:\PowerDME\ClassDME.dll"

COMMENT:
I have three CLSID values from the development machine 933..., ABD..., and
A33...
I thing the 933 and ABD are probably old versions of the ClassDME.DLL that
were compiled before "Binary Compatibility" was set and can be ignored

QUESTION:
The Development machine has an "AppID" key which is missing on the install
machine.  Is this a problem ?????

Quote:

>You say that you assume that your component is registered.
>I suggest that you make sure it is. Since this kind of error
>is caused in most cases by an class not being registered.

>Denis Gorshkov
>Mobi-Sys Software Group Inc.
>Have more than 1 VBP to compile? - Try Visual Make
>www.mobi-sys.com



>> I get the following 3 messages when I execute the code from my ActiveX
>> component DLL when installing for the first time:

>> Run Time Error '-2147467259 (80004005)': Method '~' of object '~' failed
>> Error: 440, ReportDME.Preview; Automation error
>> Error: 429, ReportDME.Preview, ActiveX component can't create object

>> I wrote the PowerDME.exe in VB 6.0 which calls the Preview method of my
>> ReportDME class which is stored in the file ClassDME.dll.
>> The ReportDME class has the Instancing property set to "5 - MultiUse".
>The
>> ClassDME.dll is compiled with the "Binary Compatibility" option.
>> I used the Package and Deployment Wizard and it added the ClassDME.dll to
>> the package just fine - I assume that it regestered.
>> I developed it on a NT 4.0 machine and get the same error on a NT 4.0
>> install as well as a Win 95 install.
>> On the development machine, the the exe runs the class fine from the
>> development folder but gets that error from the \Package\Support folder.

>> Any help would be greatly appreciated.

>> ReportDME Class:
>> ---------------------------------------

>> Option Explicit

>>     Public Connection As ADODB.Connection
>>     Public Driver As String
>>     Public ReportKey As String
>>     Public ReportName As String
>>     Public WordDoc As String

>> Public Sub Preview()

>>     On Error GoTo ErrorHandler
>>     Dim Msg As String, ErrSub As String
>>     ErrSub = "ReportDME.Preview"

>>     Dim cmd As New ADODB.Command
>>     Dim prm As ADODB.Parameter
>>     Dim rs As New ADODB.Recordset

>>     Set cmd.ActiveConnection = Connection

>>     PublicWordDoc = WordDoc

>>     Select Case ReportName
>>     Case "CMN"
>>         cmd.CommandText = "SelRptCMN"
>>         cmd.CommandType = adCmdStoredProc
>>         Set prm = cmd.CreateParameter("CustomerID", adInteger,
>adParamInput,
>> , CInt(ReportKey))
>>         cmd.Parameters.Append prm
>>         rs.Open cmd
>>         If rs.BOF And rs.EOF Then
>>             Set cmd = Nothing
>>             Set rs = Nothing
>>             Err.Raise 600, , "'" & ReportName & "' Is Empty For Customer
>#"
>> & CInt(ReportKey)
>>         End If
>>         Load rptCMN
>>         Set rptCMN.DataControl1.Recordset = rs
>>         rptCMN.Show vbModal
>>         Set rptCMN = Nothing
>>     Case "LabelCus"
>>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>>     Case "LabelDoc"
>>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>>     Case Else
>>         Err.Raise 603, , "'" & ReportName & "' is an Invalid ReportName"
>>     End Select

>>     Set cmd = Nothing
>>     Set rs = Nothing

>>     Exit Sub

>> ErrorHandler:

>>     Select Case Err
>>     Case Else
>>         Err.Raise Err, , ErrSub & "; " & Error$(Err)
>>         Exit Sub
>>         Resume
>>     End Select

>> End Sub

>> PowerDME Module:
>> ---------------------------------------

>> Public Sub gPrintReport(PassReport As String, PassKey As String,
>PassDriver
>> As String)

>>     On Error GoTo ErrorHandler
>>     Dim Msg As String, ErrSub As String
>>     ErrSub = "gPrintReport"

>>     If PassDriver = "" Then
>>         MsgBox "ERROR: Report Cannot Be Printed For '" & PassReport & "',
>> Driver Not Setup", , ErrSub
>>         Exit Sub
>>     End If

>>     Dim rpt As New ReportDME

>>     Call gOpenConnection("gPrintReport")

>>     Set rpt.Connection = conn

>>     rpt.ReportName = PassReport
>>     rpt.ReportKey = PassKey
>>     rpt.WordDoc = App.Path & "\" & PassReport & ".doc"
>>     rpt.Driver = PassDriver

>>     rpt.Preview

>>     Set rpt = Nothing

>>     Exit Sub

>> ErrorHandler:

>>     Select Case Err
>>     Case Else
>>         Screen.MousePointer = vbDefault
>>         Msg = "Error: " & Err & ", " & Error$(Err)
>>         MsgBox Msg, , ErrSub
>>         Exit Sub
>>         Resume
>>     End Select

>> End Sub



Mon, 01 Apr 2002 03:00:00 GMT  
 440 Automation error / 429 ActiveX component can't create object
I don't have VB6 here at work to test any of your code..... But if you plug the following in, hopefully you'll be able to pinpoint
the problem better.
Of course, sErrLine and all of it's supporting code can be removed after you find the error. Hope it helps..

'-------------------
Public Sub Preview()

    On Error GoTo ErrorHandler
    Dim Msg As String, ErrSub As String
    ErrSub = "ReportDME.Preview"

    Dim cmd As New ADODB.Command
    Dim prm As ADODB.Parameter
    Dim rs As New ADODB.Recordset
    Dim sErrLine As String

    sErrLine = "Set cmd.ActiveConnection = Connection"
    Set cmd.ActiveConnection = Connection

    PublicWordDoc = WordDoc

    Select Case ReportName
    Case "CMN"
        sErrLine = "cmd.CommandText = 'SelRptCMN'"
        cmd.CommandText = "SelRptCMN"
        sErrLine = "cmd.CommandType = adCmdStoredProc"
        cmd.CommandType = adCmdStoredProc
        sErrLine = "Set prm = cmd.CreateParameter"
        Set prm = cmd.CreateParameter("CustomerID", adInteger, adParamInput, , CInt(ReportKey))
        cmd.Parameters.Append prm
        sErrLine = "rs.Open cmd"
        rs.Open cmd
        sErrLine = "If rs.BOF And rs.EOF Then"
        If rs.BOF And rs.EOF Then
            Set cmd = Nothing
            Set rs = Nothing
            Err.Raise 600, , "'" & ReportName & "' Is Empty For Customer #" & CInt(ReportKey)
        End If
        sErrLine = "Load rptCMN"
        Load rptCMN
        sErrLine = "Set rptCMN.DataControl1.Recordset = rs"
        Set rptCMN.DataControl1.Recordset = rs
        sErrLine = "rptCMN.Show vbModal"
        rptCMN.Show vbModal
        sErrLine = "Set rptCMN = Nothing"
        Set rptCMN = Nothing
    Case "LabelCus"
        Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
    Case "LabelDoc"
        Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
    Case Else
        Err.Raise 603, , "'" & ReportName & "' is an Invalid ReportName"
    End Select

    sErrLine = "Set cmd = Nothing"
    Set cmd = Nothing
    sErrLine = "Set rs = Nothing"
    Set rs = Nothing

Terminate:

    Exit Sub

ErrorHandler:

    Select Case Err
    Case Else
        Err.Raise Err, sErrLine, ErrSub & "; " & Error$(Err)
        Resume Terminate
    End Select

End Sub
'----------------

Quote:

> I get the following 3 messages when I execute the code from my ActiveX
> component DLL when installing for the first time:

> Run Time Error '-2147467259 (80004005)': Method '~' of object '~' failed
> Error: 440, ReportDME.Preview; Automation error
> Error: 429, ReportDME.Preview, ActiveX component can't create object

> I wrote the PowerDME.exe in VB 6.0 which calls the Preview method of my
> ReportDME class which is stored in the file ClassDME.dll.
> The ReportDME class has the Instancing property set to "5 - MultiUse".  The
> ClassDME.dll is compiled with the "Binary Compatibility" option.
> I used the Package and Deployment Wizard and it added the ClassDME.dll to
> the package just fine - I assume that it regestered.
> I developed it on a NT 4.0 machine and get the same error on a NT 4.0
> install as well as a Win 95 install.
> On the development machine, the the exe runs the class fine from the
> development folder but gets that error from the \Package\Support folder.

> Any help would be greatly appreciated.

> ReportDME Class:
> ---------------------------------------

> Option Explicit

>     Public Connection As ADODB.Connection
>     Public Driver As String
>     Public ReportKey As String
>     Public ReportName As String
>     Public WordDoc As String

> Public Sub Preview()

>     On Error GoTo ErrorHandler
>     Dim Msg As String, ErrSub As String
>     ErrSub = "ReportDME.Preview"

>     Dim cmd As New ADODB.Command
>     Dim prm As ADODB.Parameter
>     Dim rs As New ADODB.Recordset

>     Set cmd.ActiveConnection = Connection

>     PublicWordDoc = WordDoc

>     Select Case ReportName
>     Case "CMN"
>         cmd.CommandText = "SelRptCMN"
>         cmd.CommandType = adCmdStoredProc
>         Set prm = cmd.CreateParameter("CustomerID", adInteger, adParamInput,
> , CInt(ReportKey))
>         cmd.Parameters.Append prm
>         rs.Open cmd
>         If rs.BOF And rs.EOF Then
>             Set cmd = Nothing
>             Set rs = Nothing
>             Err.Raise 600, , "'" & ReportName & "' Is Empty For Customer #"
> & CInt(ReportKey)
>         End If
>         Load rptCMN
>         Set rptCMN.DataControl1.Recordset = rs
>         rptCMN.Show vbModal
>         Set rptCMN = Nothing
>     Case "LabelCus"
>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>     Case "LabelDoc"
>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>     Case Else
>         Err.Raise 603, , "'" & ReportName & "' is an Invalid ReportName"
>     End Select

>     Set cmd = Nothing
>     Set rs = Nothing

>     Exit Sub

> ErrorHandler:

>     Select Case Err
>     Case Else
>         Err.Raise Err, , ErrSub & "; " & Error$(Err)
>         Exit Sub
>         Resume
>     End Select

> End Sub

> PowerDME Module:
> ---------------------------------------

> Public Sub gPrintReport(PassReport As String, PassKey As String, PassDriver
> As String)

>     On Error GoTo ErrorHandler
>     Dim Msg As String, ErrSub As String
>     ErrSub = "gPrintReport"

>     If PassDriver = "" Then
>         MsgBox "ERROR: Report Cannot Be Printed For '" & PassReport & "',
> Driver Not Setup", , ErrSub
>         Exit Sub
>     End If

>     Dim rpt As New ReportDME

>     Call gOpenConnection("gPrintReport")

>     Set rpt.Connection = conn

>     rpt.ReportName = PassReport
>     rpt.ReportKey = PassKey
>     rpt.WordDoc = App.Path & "\" & PassReport & ".doc"
>     rpt.Driver = PassDriver

>     rpt.Preview

>     Set rpt = Nothing

>     Exit Sub

> ErrorHandler:

>     Select Case Err
>     Case Else
>         Screen.MousePointer = vbDefault
>         Msg = "Error: " & Err & ", " & Error$(Err)
>         MsgBox Msg, , ErrSub
>         Exit Sub
>         Resume
>     End Select

> End Sub



Mon, 01 Apr 2002 03:00:00 GMT  
 440 Automation error / 429 ActiveX component can't create object
I put the code into the Preview method, redid the ClassDME.dll, copied it
the install machine, and got the following:

The first time I run the gPrintReport routine I get Msgs:
Run-time error '-2147467259 (80004005)': Automation error, Unspecified error
Error: 440, ReportDME.Preview; rptCMN.Show vbModal; Automation error

The next and all supsequent times I run it it get msg:
Error: 429, ReportDME.Preview; Load rptCMN; ActiveX component can't create
object

QUESTION:
Would this mean that I have a "rptCMN" problem but that my component is
registered and accessed just fine ???

Quote:

>I don't have VB6 here at work to test any of your code..... But if you plug

the following in, hopefully you'll be able to pinpoint
Quote:
>the problem better.
>Of course, sErrLine and all of it's supporting code can be removed after

you find the error. Hope it helps..
Quote:

>'-------------------
>Public Sub Preview()

>    On Error GoTo ErrorHandler
>    Dim Msg As String, ErrSub As String
>    ErrSub = "ReportDME.Preview"

>    Dim cmd As New ADODB.Command
>    Dim prm As ADODB.Parameter
>    Dim rs As New ADODB.Recordset
>    Dim sErrLine As String

>    sErrLine = "Set cmd.ActiveConnection = Connection"
>    Set cmd.ActiveConnection = Connection

>    PublicWordDoc = WordDoc

>    Select Case ReportName
>    Case "CMN"
>        sErrLine = "cmd.CommandText = 'SelRptCMN'"
>        cmd.CommandText = "SelRptCMN"
>        sErrLine = "cmd.CommandType = adCmdStoredProc"
>        cmd.CommandType = adCmdStoredProc
>        sErrLine = "Set prm = cmd.CreateParameter"
>        Set prm = cmd.CreateParameter("CustomerID", adInteger,

adParamInput, , CInt(ReportKey))

- Show quoted text -

Quote:
>        cmd.Parameters.Append prm
>        sErrLine = "rs.Open cmd"
>        rs.Open cmd
>        sErrLine = "If rs.BOF And rs.EOF Then"
>        If rs.BOF And rs.EOF Then
>            Set cmd = Nothing
>            Set rs = Nothing
>            Err.Raise 600, , "'" & ReportName & "' Is Empty For Customer #"
& CInt(ReportKey)
>        End If
>        sErrLine = "Load rptCMN"
>        Load rptCMN
>        sErrLine = "Set rptCMN.DataControl1.Recordset = rs"
>        Set rptCMN.DataControl1.Recordset = rs
>        sErrLine = "rptCMN.Show vbModal"
>        rptCMN.Show vbModal
>        sErrLine = "Set rptCMN = Nothing"
>        Set rptCMN = Nothing
>    Case "LabelCus"
>        Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>    Case "LabelDoc"
>        Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>    Case Else
>        Err.Raise 603, , "'" & ReportName & "' is an Invalid ReportName"
>    End Select

>    sErrLine = "Set cmd = Nothing"
>    Set cmd = Nothing
>    sErrLine = "Set rs = Nothing"
>    Set rs = Nothing

>Terminate:

>    Exit Sub

>ErrorHandler:

>    Select Case Err
>    Case Else
>        Err.Raise Err, sErrLine, ErrSub & "; " & Error$(Err)
>        Resume Terminate
>    End Select

>End Sub
>'----------------




- Show quoted text -

Quote:
>> I get the following 3 messages when I execute the code from my ActiveX
>> component DLL when installing for the first time:

>> Run Time Error '-2147467259 (80004005)': Method '~' of object '~' failed
>> Error: 440, ReportDME.Preview; Automation error
>> Error: 429, ReportDME.Preview, ActiveX component can't create object

>> I wrote the PowerDME.exe in VB 6.0 which calls the Preview method of my
>> ReportDME class which is stored in the file ClassDME.dll.
>> The ReportDME class has the Instancing property set to "5 - MultiUse".
The
>> ClassDME.dll is compiled with the "Binary Compatibility" option.
>> I used the Package and Deployment Wizard and it added the ClassDME.dll to
>> the package just fine - I assume that it regestered.
>> I developed it on a NT 4.0 machine and get the same error on a NT 4.0
>> install as well as a Win 95 install.
>> On the development machine, the the exe runs the class fine from the
>> development folder but gets that error from the \Package\Support folder.

>> Any help would be greatly appreciated.

>> ReportDME Class:
>> ---------------------------------------

>> Option Explicit

>>     Public Connection As ADODB.Connection
>>     Public Driver As String
>>     Public ReportKey As String
>>     Public ReportName As String
>>     Public WordDoc As String

>> Public Sub Preview()

>>     On Error GoTo ErrorHandler
>>     Dim Msg As String, ErrSub As String
>>     ErrSub = "ReportDME.Preview"

>>     Dim cmd As New ADODB.Command
>>     Dim prm As ADODB.Parameter
>>     Dim rs As New ADODB.Recordset

>>     Set cmd.ActiveConnection = Connection

>>     PublicWordDoc = WordDoc

>>     Select Case ReportName
>>     Case "CMN"
>>         cmd.CommandText = "SelRptCMN"
>>         cmd.CommandType = adCmdStoredProc
>>         Set prm = cmd.CreateParameter("CustomerID", adInteger,
adParamInput,
>> , CInt(ReportKey))
>>         cmd.Parameters.Append prm
>>         rs.Open cmd
>>         If rs.BOF And rs.EOF Then
>>             Set cmd = Nothing
>>             Set rs = Nothing
>>             Err.Raise 600, , "'" & ReportName & "' Is Empty For Customer
#"
>> & CInt(ReportKey)
>>         End If
>>         Load rptCMN
>>         Set rptCMN.DataControl1.Recordset = rs
>>         rptCMN.Show vbModal
>>         Set rptCMN = Nothing
>>     Case "LabelCus"
>>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>>     Case "LabelDoc"
>>         Err.Raise 601, , "'" & ReportName & "' is Not Yet Available"
>>     Case Else
>>         Err.Raise 603, , "'" & ReportName & "' is an Invalid ReportName"
>>     End Select

>>     Set cmd = Nothing
>>     Set rs = Nothing

>>     Exit Sub

>> ErrorHandler:

>>     Select Case Err
>>     Case Else
>>         Err.Raise Err, , ErrSub & "; " & Error$(Err)
>>         Exit Sub
>>         Resume
>>     End Select

>> End Sub

>> PowerDME Module:
>> ---------------------------------------

>> Public Sub gPrintReport(PassReport As String, PassKey As String,
PassDriver
>> As String)

>>     On Error GoTo ErrorHandler
>>     Dim Msg As String, ErrSub As String
>>     ErrSub = "gPrintReport"

>>     If PassDriver = "" Then
>>         MsgBox "ERROR: Report Cannot Be Printed For '" & PassReport & "',
>> Driver Not Setup", , ErrSub
>>         Exit Sub
>>     End If

>>     Dim rpt As New ReportDME

>>     Call gOpenConnection("gPrintReport")

>>     Set rpt.Connection = conn

>>     rpt.ReportName = PassReport
>>     rpt.ReportKey = PassKey
>>     rpt.WordDoc = App.Path & "\" & PassReport & ".doc"
>>     rpt.Driver = PassDriver

>>     rpt.Preview

>>     Set rpt = Nothing

>>     Exit Sub

>> ErrorHandler:

>>     Select Case Err
>>     Case Else
>>         Screen.MousePointer = vbDefault
>>         Msg = "Error: " & Err & ", " & Error$(Err)
>>         MsgBox Msg, , ErrSub
>>         Exit Sub
>>         Resume
>>     End Select

>> End Sub



Mon, 01 Apr 2002 03:00:00 GMT  
 440 Automation error / 429 ActiveX component can't create object
It sounds like that's the case....
If you goto the immediate window and type 'Error 440 <enter>' then press help, you get the following:

'--------
An error occurred while executing a method or getting or setting a property of an object variable. The error was reported by the
application that created the object.
'--------

The second sentence states that the error was raised by your component while it was trying to create an object. It could very well
be that your posted code may be fine. We need to find out what's going on with 'rptCMN' since it was the problem in both cases.

Quote:

> I put the code into the Preview method, redid the ClassDME.dll, copied it
> the install machine, and got the following:

> The first time I run the gPrintReport routine I get Msgs:
> Run-time error '-2147467259 (80004005)': Automation error, Unspecified error
> Error: 440, ReportDME.Preview; rptCMN.Show vbModal; Automation error

> The next and all supsequent times I run it it get msg:
> Error: 429, ReportDME.Preview; Load rptCMN; ActiveX component can't create
> object

> QUESTION:
> Would this mean that I have a "rptCMN" problem but that my component is
> registered and accessed just fine ???



Mon, 01 Apr 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Run-time error '429': ActiveX component can't create object

2. Run-Time Error '429': ActiveX component can't create object

3. Run time error '429': ActiveX component can't create object

4. Run-time error '429': ActiveX component can't create object

5. Run time error '429': ActiveX component can't create object

6. Run-Time Error '429': ActiveX component can't create object

7. ActiveX component can't create object or return reference to this object (Error 429)

8. Error#429: ActiveX component can't create object

9. Error#429: ActiveX component can't create object

10. Error 429 - ActiveX component can't create object

11. Error 429: ActiveX component can't create object

12. Error: (429) ActiveX component can't create object

 

 
Powered by phpBB® Forum Software