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