Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM class factory failed due to the following error: 80040154 :|

Status
Not open for further replies.

Rodrigue

Programmer
Feb 22, 2008
8
CA
I happen to get the following COMException when the program gets to the Init() lines. The same occurs when I comment both Init() lines on the Browse().

Error Message : "Retrieving the COM class factory for component with CLSID {25E6B455-8B9D-B5A9-0060083B07C8} failed due to the following error: 80040154."

This error generally happens for dependencies issues between COM objects, that I know. But I can’t trace what object this CLSID points to, since I can’t find it anywhere in the registry. I think that the object which depends on this pointed to by the CLSID object is the ACCPACXPILib object.

Furthermore, when I don’t get this CLSID error, I do have another one that comes out exactly at the same lines which says "View : AR0024. View call failed". I don’t get why since it seems to come directly from the COM.

Language Used: Visual C# 2.0 with VS2005
Database: Tested on both SQL Server and Pervasive SQL 9
OS: Tested on both Vista 32-bits and XP 32-bits (known compatibility issues with 64-bits OS)

Source:
private int Insert()
{
xapiSession session = new xapiSession();
IxapiView arcus;
IxapiView arcuso;

try
{
session.Open(Settings.Default.UserName, Settings.Default.UserPassword, Settings.Default.Database, DateTime.Today, 0);

arcus = session.OpenView("AR0024", "AR"); // view AR0024 points to table ARCUS within the database.
arcuso = session.OpenView("AR0400", "AR"); // view AR0400 points to table ARCUSO within the databse.

arcus.Compose(new object[] { arcuso });
arcuso.Compose(new object[] { arcus });

arcus.Init();
arcuso.Init();

arcus.Browse("IDCUST=" + this.idcust, 1); // view.Browse("FIELDID=VALUE", 0[1]) - 0 = browse descending, 1 = browse ascending

if (arcus.Fetch() == 0)
return 0;
}

catch (System.Runtime.InteropServices.COMException ex)
{
throw new Exception("Error : " + ex.ErrorCode + " :\n" + ex.Message);
}

arcus.Fields.Item("IDCUST").Value = this.idcust;
arcus.Fields.Item("NAMECUST").Value = this.namecust;
arcus.Fields.Item("IDGRP").Value = this.idgrp;
arcus.Fields.Item("PRICLIST").Value = this.priclist;
arcus.Fields.Item("CODETAXGRP").Value = this.codetaxgrp;
arcus.Fields.Item("TEXTSTRE1").Value = this.textstre1;
arcus.Fields.Item("TEXTSTRE2").Value = this.textstre2;
arcus.Fields.Item("TEXTSTRE3").Value = this.textstre3;
arcus.Fields.Item("TEXTSTRE4").Value = this.textstre4;
arcus.Fields.Item("NAMECITY").Value = this.namecity;
arcus.Fields.Item("CODESTTE").Value = this.codestte;
arcus.Fields.Item("CODEPSTL").Value = this.codepstl;
arcus.Fields.Item("CODECTRY").Value = this.codectry;
arcus.Fields.Item("NAMECTAC").Value = this.contact.Name;
arcus.Fields.Item("CTACPHONE").Value = this.contact.PhoneNumber;
arcus.Fields.Item("CTACFAX").Value = this.contact.FaxNumber;
arcus.Fields.Item("EMAIL1").Value = this.contact.Email;
arcus.Fields.Item("TEXTPHON1").Value = this.textphon1;
arcus.Fields.Item("TEXTPHON2").Value = this.textphon2;
arcus.Fields.Item("EMAIL2").Value = this.email2;
arcus.Fields.Item("TEXTSNAM").Value = this.textsnam;
arcus.Fields.Item("SWPRTSTMNT").Value = 1;

try
{
arcus.Insert();
return 1;
}
catch { return 0; }
}

Source pulled out from my AccpacCustomer class. Method called from the public Save() method of the object. As for the Settings.Default.VarName thing, these are settings I put directly into my application setting configurations, and I insured they are the right credentials and everything.

I humbly suspect an environment trouble, since I sent my this test project to a friend programmer who knows the Accpac SDK better than I, and this codes runs fine under his environment. I really don’t get it. Because of this "out-of-nowhere" trouble, I’m late on my project schedule. :'(

Thank’s sincerely for any of your help
 
Accpac versions?
There is a known issue fixed in the latest SM5.4 service pack.
Also run REGACC to register all Accpac objects, on Vista you need to specifically run this as administrator.
Can you open the AR Customers screen on your computer?
 
Accpac version: 5.4A
REGACC has been run without result.
And yes i'm able to open the AR Customer in Accpac.

I'm dowloading the lastest service pack right now. If you have any other idea let me know.

Thanks.
 
Just some comments:
You are not adding any optional fields, so remove everything relating to ARCUSO from your code - unless you plan to use ARCUSO.
Take out arcuso.Init(); - you don't need it anyway.
 
The 80040154 error relates to a DLL that is not properly registered or found, or a supporting DLL is not registered or found.
Open REGEDIT and look for {25E6B455-8B9D-B5A9-0060083B07C8} under HKCR\CLSID, open the key and look for InProcServer32 - that should point to the DLL.
Try the Sysinternals utilities ( listdlls and procexp, this may help you out.
 
Thanks for the comment but I will need ARCUSO later and anyway the error pops on Arcus.Init().

I've already tried to look for the CLSID in regedit but I can't find it!!! I must be the source of my problem but since I can't find this CLSID I don't know witch DLL I need to register to fix my problem.

Right now I run only 1 demo version of Accpac. It has been installed, removed and re-installed. I don't know if it can give you a clue.
 
OK, maybe try unregister the Accpac DLLs and register it again.
Run REGACC /U to unregister followed by REGACC to register.
 
Also check your PATH environment variable, you should have only one reference to \Accpac\Runtime in there and it should match the Accpac icon properties.
 
I've tried to unregister and register DLLs, no changes....

And my Windows path varible is ok. It has a reference to C:\Program Files\Sage Software\Accpac\Runtime and that's where my Accpac.exe is.

Still have the same error... :'(
 
I had a similar type error on a program I wrote once. It turned out that it was the clients anti virus causing the problems. Its kind of a shot in the dark.

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top