[AccessD] Multithreading in VBA

DWUTKA at marlow.com DWUTKA at marlow.com
Wed May 10 10:07:38 CDT 2006


Actually, when dealing with Access, Multithreading would be a problem even
if VBA let you.  I've written multithreading VB 6 .exes.  It works great,
but you can't have more then one thread dealing with one .mdb at a time.  I
have a test program that just dumps data into a table in an .mdb.  One
thread will go until the database fills up.  However, the more threads you
have the faster they will crash (from write errors), and when the last
thread is closed the database is corrupted.  (Recoverable, but corrupted).
That is because the threads are being 'cycled' by the OS, and it doesn't
really care when, so JET could be checking for a lock in one thread, and
then the next thread to run may be setting a lock that the early thread just
set.  As you might guess, that will add up to trouble in a hurry.

Drew

-----Original Message-----
From: Gustav Brock [mailto:Gustav at cactus.dk]
Sent: Wednesday, May 10, 2006 3:28 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Multithreading in VBA


Thanks Drew. 
It would have been nice, of course, and would it had been possible, I guess
I would have read about it elsewhere but I haven't.

/gustav

>>> DWUTKA at marlow.com 09-05-2006 22:09 >>>
Unfortunately no.  Even in VB6, you cannot run multiple threads in debug
mode.  Technically, when you run VBA, it's similar to debug mode.

Drew

-----Original Message-----
From: Gustav Brock [mailto:Gustav at cactus.dk] 
Sent: Tuesday, May 09, 2006 12:44 PM
To: accessd at databaseadvisors.com 
Subject: [AccessD] Multithreading in VBA


Hi all

I noticed this article about multithreading in VB6:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=14479&ln
gWId=1

and wonder if that tip can be transferred to VBA (Access)?

/gustav

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list