I have an interesting DTS issue that I have not been able to find covered

I have a table that I query in DTS that gives me a list of queries to run
and the files to export them to.

I want to run this query from and activescript task and then for each row in
the task execute a transform to export the data.

The problem that I run into is that looping does not appear to be
straightforward once I leave the activexscripttask.

Any suggestions?