Can I run a Progress program from javascript ADO?

Posted by S33 on 31-Oct-2014 09:54

Hi --

I want to use a javascript function to run a Progress program. Is this possible? I found an example that is close:

function connectDb()
  {
  var ConnDB = new ActiveXObject("ADODB.Connection");
  ConnDB.ConnectionString="dsn=MyDSN;uid=foo;pwd=bar;";
  ConnDB.Open();
  var Rs = new ActiveXObject("ADODB.Recordset");
  var tempstr="";
  Rs.Open("select * from customer",ConnDB,1,3);
  while(!Rs.EOF)
  {
  tempstr = tempstr + Rs("name") + "<br>";
  Rs.MoveNext;
  }
  }

That Rs.Open command contains a SQL command, and I think I could tweak this to use a SQL stored proc. But is there a way to run a Progress 4GL program,
and if so, how would it know where that program resided?

TIA - Jim

All Replies

Posted by Youssif Shanshiry on 31-Oct-2014 10:09

Hi Jim,
 
 
function runProgram()
        {
            var shell = new ActiveXObject("WScript.Shell");                
            var appWinMerge = "\"C:\\Program Files\\WinMerge\\WinMergeU.exe\" /e /s /u /wl /wr /maximize";
            var fileLeft = "\"D:\\Path\\to\\your\\file\"";
            var fileRight= "\"D:\\Path\\to\\your\\file2\"";
            shell.Run(appWinMerge + " " + fileLeft + " " + fileRight);
        }
Best Wishes,
 
Youssif H. Shanshiry
Principal Customer Support Engineer
Progress
PROGRESS SOFTWARE
16 Oak Park Drive | Bedford, MA 01730 | USA
PHONE 781.280.3028
MOBILE 617.529.8135
Twitter
Facebook
LinkedIn
LinkedIn
Green TreePlease consider the environment before printing this email
 
[collapse]
From: S33 [mailto:bounce-S33@community.progress.com]
Sent: Friday, October 31, 2014 10:55 AM
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] Can I run a Progress program from javascript ADO?
 
Thread created by S33

Hi --

I want to use a javascript function to run a Progress program. Is this possible? I found an example that is close:

function connectDb()
  {
  var ConnDB = new ActiveXObject("ADODB.Connection");
  ConnDB.ConnectionString="dsn=MyDSN;uid=foo;pwd=bar;";
  ConnDB.Open();
  var Rs = new ActiveXObject("ADODB.Recordset");
  var tempstr="";
  Rs.Open("select * from customer",ConnDB,1,3);
  while(!Rs.EOF)
  {
  tempstr = tempstr + Rs("name") + "<br>";
  Rs.MoveNext;
  }
  }

That Rs.Open command contains a SQL command, and I think I could tweak this to use a SQL stored proc. But is there a way to run a Progress 4GL program,
and if so, how would it know where that program resided?

TIA - Jim
Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Phillip Molly Malone on 02-Nov-2014 19:01

Depending on my what you are trying to achieve, what about having the program called via a REST webservice? OpenEdge can handle that.

This thread is closed