I'm doing something similar right now. (Gonna try DBScript when I
upgrade to Snow Leopard). I handle it more like this:
mapCommandToBCF('syncTable', syncTableBCF);
mapCommandToVCF('syncTable', syncTableVCF);
function syncTableBCF() {
// Start Transaction
// Empty Table
// Loop the Inserts
// Commit Transaction
}
function syncTableVCF() {
// display info on web page
setTimeout("container.innerText='blah'", 12000);
}
When you display the info on the web page, use innerText, not
innerHTML. If you have to write HTML and not text, write the whole
DOM tree, and don't use innerHTML. Also comment out all your debug in
the VCF functions as this seems to kill anything you try to do on a
web page. If you put a debug message in the VCF function, you will
see that it gets called multiple times (each time per insert). I
think this is why there is a strange side-effect on how things get
rendered on the web page. That's also why I have it inside a
setTimeout, since the status will get rendered on the web page after
the 1st insert, not last. Put a debug message in your insert loop to
figure out how long the inserts will take .. then add like 5-10
seconds to make sure the inserts are finished before you go on. BTW,
the newer processors (3GS and the new ipod) have more powerful CPUs
and insert far faster than the older devices, so you'll have to
setTimeout for the older devices.
Sounds horrible right? It is!
Although I haven't used it yet, I would strongly suggest going in the
direction of using DBScript. I'm not sure what issue you are facing
with it, but if you can provide more details, Lee can probably help
you. makeCall('runDBScript') isn't any syntax I've seen in
QuickConnect.
Jimmy