Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simultaneous execution of multiple VBA codes 2

Status
Not open for further replies.

roelmcebu

Technical User
Feb 14, 2004
27
PH
how do I execute several VBA codes using only one mother VBA code. Timing is critical because I want to retrieve data from several sources at the same time. If not possible...a few seconds difference is acceptable.

Is this possible?

Thanks for the response.
 
write a "mother" procedure which calls each of the seperate procedures which gather the seperate 'buckets' of information.

" ... several seconds ... " is sort-of an auto "Can Grow" & "Can Shrink" property for the time, as each indivdual fetch will depend ofn its' properties and location (access speed). In a small workgroup, with moderate sized objects, your few seconds might be literally achievable in other situations, it could be interperted more broadly.




MichaelRed


 
@MichaelRed,

if each CALLed separate procedure takes 2minutes to finish by the time I reach the 20th CALLed procedure the result of the 1st procedure that was CALLed is already 38minutes old.

any other way?

thanks.
 
What you are describing sounds like multithreading (i.e. several "threads" of code execution occurring at the same time). To the best of my knowledge VBA does not support it.


Regards,
Mike
 
Doesn't make any difference wheather the process is multithreades or not unless you consider the overhead or the threading -whic would increase the total time.

Only rational time reduction here would involve multi PROCESSOR system, even there, the 'concurrency' would be subject to the time of the longest processing unit.

If the timing concurrency is critical to tet degree you indicate, a possible soloution might be found in the net-admin area. Typically, net-admin is responsible for routine backup of the network, and usually, this can be set to force users out of specifiv applications/files. If the situation is sufficiently critical, htey could be convinced by the "higher ups" to force the component files to be locked while the back up is in progress and create a copy of the specific files for your use the folowing period (day).

Another option might be to have the various data stores generate seperate copies of the info you are after after the close of business at each location, and either forward these to you or at least locate (save) them in a specific place on the network for you to retrieve.

In the general sense, database routines are not so active that the few minutes taken to grab the various recordsets is critical. This is particularly true of aggregations of date, which is what your system sounds like (from way far out here). Twenty seperate recordsets taking up top 2 minutes each to retrieve SOUNDS LIKE gathering the daily activity of the seperate branches of a larger entity (chain of stores?). The activity over a 1 hour span will not normally skew an aggregate report to provide any noteworthy distortion.




MichaelRed


 
I guess I just have to execute them one by one in sequence.

thanks guys for the ideas!
 
how long will it take IT to catch up with Concurrent Engineering, or should i say how long will it take us to make this our 'real' goal.?
 
i read an interesting post in the vbscript forum by dilenttee (sorry if i mispelled that) it talks about mother and child processes...seemed to hint at async or concurrent processing as opposed to serial/sequencial. used....

Set objMotherInfo = CreateObject("MSMQ.MSMQQueueInfo")
 
this is a hot topic for me as been looking at CE architecture for multiple device app deployment with app dependancies.
all that is required is that the other threads you are trying to run are not blocked method calls and have a method of passing back info on current status or can be re-queried for their status. i know this sounds alot like event notification but in reality this level of 'coolness' isnt required.

anyway, this topis is holding my interest...for now ;-)
 
regardless of the tips and tricks, the typical app does not gain much from the pseudo multithreading. Occassional exceptions can occur, if the several processes are I/O bound AND are the "binding" is not common. Typically, the last is the killer, with the I/O being the local (desktop?) sytem. The "PC World" started life as a far flung collection of independent platforms with I/O typically limited to localally attached devices. External communication was primarily through "floppy discs" with an occassional lapse to an rs-232 (e.g. serial) port. Dispite many impressive advances in processor power, local storage capacity and even connectivity, it remains a dreadful I/O handler.

THe above is NOT intended as a discourgemnt or to disparage the efforts to overcome these limitations, just an aside to perhaps provide the incentive to show me how much improvement has bee made.




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top