none
Resolving COM Class Errors RRS feed

  • Question

  • Hello, I would like to know more regarding COM component object module errors and how to solve them please  Regards JohnDBCTX   

    

    jp

    Sunday, December 23, 2018 1:19 PM

All replies

  • Your question is  far to vague to answer.  You need to provide the specific COM object and the error. 
    Sunday, December 23, 2018 2:08 PM
  • I would need to change its advanced compiler settings to x86 within the Target CPU settings.

    I did not make this solution up.

    I may have gotten this from this source link below from one of the earlier forums.

    Modifying its CPU Target settings to x86

    That could be one of its common COM error solutions.

    Agreed?

    Regards,

    JohnDBCTX


    jp

    Wednesday, December 26, 2018 5:59 AM
  • I would need to change its advanced compiler settings to x86 within the Target CPU settings.

    I did not make this solution up.

    I may have gotten this from this source link below from one of the earlier forums.

    Modifying its CPU Target settings to x86

    That could be one of its common COM error solutions.

    Agreed?

    Regards,

    JohnDBCTX


    jp


    That's for example: error 80040154 just to name one of the countless.

    jp

    Wednesday, December 26, 2018 6:01 AM
  • Since you need to recompile I assume you have the COM source.  Building COM DLLs is beyond this forum.  It is a complex process. To give you an idea of what you need to do:

    1. Open COM solution in Visual Studio.

    2. In the project properties set target platform.

    3. Rebuild solution

    Wednesday, December 26, 2018 1:53 PM
  • Which version you have got this snapshot from? Version 2017 community?

    Would version 2017 and future versions should solve COM DLL errors easier depending on their interfaces?

    Regards

    JohnDBCTX


    jp


    • Edited by JohnDBCTX Thursday, December 27, 2018 5:35 AM Refining edit
    Thursday, December 27, 2018 5:33 AM
  • It is VS Community 2017.  COM DLLs haven't changed since mid 2000 so version is not important.  If you are serious about developing COM and .NET DLLs I recommend this book - COM and .NET Interoperability by ANDREW TROELSEN.  It is old (2003) but you can find used copies on Amazon.
    Thursday, December 27, 2018 12:58 PM
  • I may have found some solutions.

    Imports Microsoft.Office.Interop.Access.Dao
    Imports System.Runtime.InteropServices.COMException

    This may work for all versions up to 2017 and later.

    In the Target CPU drop down control, I have set it to x86 option.

    In addition, I may have rebuilt its COM module just to ensure its compatibility configuration.

    This may also work with other COM libraries within the Office suite versions.

    Public Class Form1
        Private DB As Database
        Private Table_Name As Recordset
        Private ENG As DBEngine
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            ENG = New DBEngine
            DB = ENG.OpenDatabase("C:\FileName.mdb")
            Table_Name = DB.OpenRecordset("TableName")
            Primary_Key_Table_Name_One_ID.Text = TableNameOne.Fields(1).Value
            Table_Name_One_Text_Box.Text = TableNameOne.Fields(0).Value
    
    
        End Sub
    
    End Class

    Ran it, no runtime errors. 

    Regards,

    JohnDBCTX



    jp

    Friday, December 28, 2018 4:21 PM
  • I may have found some solutions.

    Imports Microsoft.Office.Interop.Access.Dao
    Imports System.Runtime.InteropServices.COMException

    This may work for all versions up to 2017 and later.

    In the Target CPU drop down control, I have set it to x86 option.

    In addition, I may have rebuilt its COM module just to ensure its compatibility configuration.

    This may also work with other COM libraries within the Office suite versions.

    Public Class Form1
        Private DB As Database
        Private Table_Name As Recordset
        Private ENG As DBEngine
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            ENG = New DBEngine
            DB = ENG.OpenDatabase("C:\FileName.mdb")
            Table_Name = DB.OpenRecordset("TableName")
            Primary_Key_Table_Name_One_ID.Text = TableNameOne.Fields(1).Value
            Table_Name_One_Text_Box.Text = TableNameOne.Fields(0).Value
    
    
        End Sub
    
    End Class

    Ran it, no runtime errors. 

    Regards,

    JohnDBCTX



    jp

    You may have found a solution for your undisclosed particular problem but this is hardly the encyclopedia of solutions for all COM errors that you asked for in your initial post.
    Friday, December 28, 2018 4:32 PM