NEW Multithreading demo. Database Table Monitor - FULL DEMO PROJECT
OK...some of you may have seen the file searching multithreading example I wrote. If so, then this project will be a little easier to understand.
This project is a 3-tier DB application that uses property bags to communicate between tiers.
Basically the the application creates a seperate thread that "monitors" a table for any changes. If there are any changes made then the thread sends the new data back to the main data objects, which in turn populates a grid.
The beauty of this is that the monitoring project runs in it's own thread and thus can monitor a table without affecting the performance of your client user interface.
Included in this ZIP are 6 projects
vbTools2
vbPropertyBagServer
vbPropertyBagObjects
vbPropertyBagDemo
DB Monitor Thread
DB Monitor Thread Proxy
Dependancies:
DB Monitor Thread references vbPropertyBagServer and vbTools2
DB Monitor Thread Proxy references vbTools2
vbPropertyBagObjects references vbPropertyBagServer and DB Monitor Thread Proxy
vbPropertyBagDemo references vbPropertyBagObjects
The access database needs to be located in C:\Database, although you can change this location in the modDatabase module in the vbPropertyBagServer project.
OK...to get this up and running compile the projects, making sure you have set the relevant references, in the following order:
vbTools2
vbPropertyBagServer
VB Monitor Thread
VB Monitor Thread Proxy
vbPropertyBagObjects
vbPropertyBagDemo
Now run vbPropertyBagDemo...and hopefully, if you have done things correctly it will all work.
If you launch 2 EXE's then you can test the DB Monitor and watch the listview update automatically.
The DB Monitor displays it's form, that shows you any errors that may occur. This if purely for debugging purposes and the .Show command is not required for the app to work.
Hmmmmmmmmm...
If you click on Project...References...does it say any are missing?
I have just wiped all DLL's and stuff from my machine and recompiled everything and it compiles fine for me...
Does the MyThread project have a module called modFunctions in it?
Woka
Last edited by Wokawidget; Jan 21st, 2004 at 07:18 AM.
Ok that was it for most of the problems.
MISSING VBTools2.dll and MISSING vbPropertyBagServer now seem to be permanent references in my compiler. Just had to remove the checkmarks and lead it to the right ones.
But I did hit another snag when i tried to compile vbPropertyBagDemo
I get "User defined type not defined" on line:
Private WithEvents mobjUsers As Users
!!!! Never mind i found it. I guess learing something like this is a bad idea when u have a bad case of insomnia going on *)
Last edited by longwolf; Jan 21st, 2004 at 08:57 AM.