Understanding variable scoping with async statements
-
29-10-2019 - |
Вопрос
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
?
Нет правильного решения
Не связан с StackOverflow