Select ... From ... Where DB_YEAR = $(year) And DB_WEEK = $(week);
...
End Sub
Call Load_DB(2010, 31);
Call Load_DB(2010, 32);
Call Load_DB(2010, 33);
Call Load_DB(2010, 34);
Call Load_DB(2010, 35);
Call Load_DB(2010, 36);
Call Load_DB(2010, 37);
Store in QVD;
end of script
Well, the select is about 125 lines with a lot of pre-calculation so I do not detail it here but I really need to calculate one week at a time.
Problem is that after few call of the sub, the script quits with error. Number of call before error is not always the same... depends on the moon maybe ?
I had a problem before when sometimes QV didn`t recognize the sub, but them none of them would work.
Can you change the sub, so qv will wait between two calls? (try including a sleep 100 before the end sub).
Another approach would be:
- Create a table with all the years and weeks you need to load, then you create a loop to read those records one by one and then you reprodure the code of your sub.