Login ActiveXObject

Is it still possible to use this code to login to Sage CRM?

var username = "Admin";
var password = "";
var CRM = new ActiveXObject("eWare.CRM");
CRM.FastLogon = 3; //this prevents the meta data from loading.
CRM.Logon(username,password);

When I use this, I am getting the following error...Automation server can't create object

Which shows it is failing on this line...

var CRM = new ActiveXObject("eWare.CRM");

Not sure what I am doing wrong.  Any assistance would be greatly appreciated.  Thanks!

Parents Reply
  • 0 in reply to Don Grubor

    On 64-bit Windows, if you double-click the .js file it executes under the 64-bit version of wscript.exe.  eWare.CRM is a 32-bit component, so it fails to create the object in the 64-bit environment.  Create a batch file to execute the .js file with wscript.exe (or cscript.exe) 32-bit:

    %systemroot%\SysWOW64\wscript.exe <Yourscript.js>

Children
No Data