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
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