WalterHeisenberg
Technical User
- Mar 28, 2008
- 159
Hello,
I have been asked to convert some vb windows apps into c#. I seem to be unable to create a dblink although I have had no problems in anything else I have done.
Here is the code I have so far:
I have been asked to convert some vb windows apps into c#. I seem to be unable to create a dblink although I have had no problems in anything else I have done.
Here is the code I have so far:
Code:
public AccpacSession OpenSession(AccpacSession session)
{
session.Init("", "XX", "XX1000", "56A");
session.Open(userName, userPassword, dataBase, sessionDate, flags, reserved);
return session;
}
public AccpacDBLink CreateCompanyLink(AccpacSession session)
{
AccpacDBLink link = session.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_COMPANY, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE);
return link;
}
session = lib.OpenSession();
dbLink = lib.CreateCompanyLink(session);
I get the following error:
failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))..
I am using Interop.AccpacCOMAPI.dll in many other projects (all vb) with no issues. The session is indeed being opened. I am using accpac 5.6 PU2, .net 4.0, sql svr 2008 r2, windows 7 with UAC disabled.
Feel like I must be missing something obvious but this is driving me up a wall! Thank you for reading this.