Skip to Content
0
May 23, 2013 at 09:19 AM

Can not connect to second company after 9.0 upgrade

39 Views

See my source code below:

//Connect to UI APISboGuiApi SboGuiApi = new SboGuiApi();string connString = Environment.GetCommandLineArgs().GetValue(1).ToString();SboGuiApi.Connect(connString);application = SboGuiApi.GetApplication();// Connect to DI API (first company)company1 = (SAPbobsCOM.Company)application.Company.GetDICompany();// Connect to DI API (second company)company2 = new SAPbobsCOM.Company();string cookie = company2.GetContextCookie();string connContext = application.Company.GetConnectionContext(cookie);if(company2.SetSboLoginContext(connContext) == 0){                company2.CompanyDB = "dbname2";                company2.Connect();                if(!company2.Connected){                    SAP.application.StatusBar.SetText(company2.GetLastErrorDescription(), BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);                    // STOP                }}System.Windows.Forms.Application.Run();

My add-on makes a DIAPI connection with 2 companies. This code worked well with SAPB1 8.82. When I did the upgrade to 9.0 PL04 previous week, my add-on no longer connects to the second company and gives this error: "Unable to connect with the specified username and or password".

What must be changed in my source code to make the connection of the second company to work again?

Thanks for you help!

Regards,

Pieter