well when the app is offline some values are stored on a local table
tActions, once that it gets online the following function is executed
to retrieve all values from that table and update the server's DB,
sending the retrieved values to the script: update_actions.asp? .....
but, just the firstone is executed for the next one I retrieve the
"request is already open" and stops there.

function actions_retrieve()
{
        open_tActions();//opens the required table
        var update_string = "";
        var rs = db.execute('select * from tActions');

        while (rs.isValidRow())
        {
                update_string = "update_action.asp?tActionsID="+[rs.field(0)]
+"&CompanyID="+[rs.field(1)]+"&CdEmp="+[rs.field(2)]+"&PsEmp="+
[rs.field(3)]+"&ActionTypeID="+[rs.field(4)]+"&Hour="+[rs.field(5)]
+"&Minute="+[rs.field(6)]+"&Second="+[rs.field(7)]+"&Month="+[rs.field
(8)]+"&Day="+[rs.field(9)]+"&Year="+[rs.field(10)];


                request.open('GET',update_string);

                request.onreadystatechange = function()
                {
                  if (request.readyState == 4) {
                                if (request.responseText == "OK")
                                {
                                        db.execute('delete from tActions where 
tActionsID =?', [rs.field
(0)]);
                                }
                  }
                };
                request.send();
                rs.next();
         }
        rs.close();

}


Reply via email to