AccpacCOMAPI

SUGGESTED

Hi there,

I have a client on Sage 300 5.6 and have upgraded them to 2020. There was some legacy code written to connect an external program through the AccpacCOMAPI but it is now broken. Specifically, when I try to run this, it fails when trying to open and says 'Invalid Signon Information. Make sure you supply the correct User ID and Password.' The username, password and database are definitely still correct.

I feel like this is the code that broke:

var Accpac = new ActiveXObject("ACCPAC.Session");
if (ServerName.substr(0,6).toLowerCase() == 'net://')
{
    Accpac.RemoteConnect (ServerName, UserId, UserPassword, "");
}
Accpac.Init ("", "EW", "EW9999", "56A");
Accpac.Open(UserId, UserPassword, Database, now.getVarDate(), 1, "");
Has this connection been depricated? If not, is there something that jumps out to any of you that may indicate what broke here and how to fix it?
EDIT: relevant conditional statement added to the code
Parents
  • 0
    SUGGESTED

    I would try changing the parameters of the .init line:

    Accpac.Init "", "XY", "XY0001", "67A"

    I've seen that fix things.  Also, try running the legacy application As Adminstrator.  I've found that you can create the Session object without sufficient security rights because it isn't doing anything.  But when you call .Open it is now trying to access the files in the SharedData path and if you don't have the correct rights to access that then you'll get that error even with the right username and password.

Reply
  • 0
    SUGGESTED

    I would try changing the parameters of the .init line:

    Accpac.Init "", "XY", "XY0001", "67A"

    I've seen that fix things.  Also, try running the legacy application As Adminstrator.  I've found that you can create the Session object without sufficient security rights because it isn't doing anything.  But when you call .Open it is now trying to access the files in the SharedData path and if you don't have the correct rights to access that then you'll get that error even with the right username and password.

Children
  • 0 in reply to Django

    Hello Django,

    Thank you for the advice here. I tried changing the .init line and I still get the same error. When you mention running the legacy application as administrator, are we talking about the Sage 300 .exe file?

    This code is actually being written from within a custom asp page in Sage CRM and worked until we upgraded Sage 300 in the test environment.

    Web deployment is no longer supported by Sage, is this something that affects this error?