Understanding variable scoping with async statements
-
29-10-2019 - |
Frage
When I do the following:
for (var CurrentRow=0;CurrentRow < qryMfg.RecordCount;CurrentRow++){
console.log(qryMfg.MFGID[CurrentRow]);
dbo.transaction(function(myTrans) {
console.log(qryMfg.MFGID[CurrentRow]);
});
}
I get a list of MfgID the way that I want, followed by a list of unknowns because dbo.transaction
is executing asynchronously.
How do I pass a variable into dbo.transaction
?
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow