Understanding variable scoping with async statements
-
29-10-2019 - |
Pergunta
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
?
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow