-
September 29th, 2004, 08:47 AM
#1
Multiuser application
Hi.
My question is as follows.
I have an application which apx. 4 users will use. This app is connected to an MS-Access database.
For example, on the left side of the application, there is a treeview which contains a certain structure(retrieved from a table in the database). Each user is able to change this structure, i.e. add or remove nodes.
Now my little problem arrives. If one of the users adds(or removes) a node from the list, how do I notify the other users of the change?
Is there any event in the ADODB.Recordset object or the Connection object that fires when a change occures?
I've tried one solution, however I don't know wether it's the appropriate way of doing it.
I have table in the database called MainTbl, which contains only one record. This record has one field of Date type.
Every time a user changes the structure in the treeview list, the current time is written to the specified field.
In the application there is a timer control set to a specified interval which checks the MainTbl record, and compares it to a locally stored variable, which contains the time/date of the record the previous time the timer event occured.
If these dates/times doesn't match I update the treeview.
Hope someone could give me some information on this.
Regards,
Michael Nattfalk
-
September 29th, 2004, 09:03 AM
#2
Re: Multiuser application
I remember trying to do something simillar a while ago. I ended up opting for a timer method though.
I did find that there is an event in a dao data control called Data1_Reposition that, unless I am badly mistaken fires every time the data is changed. I still consider myself a novice using ado control though.
Hope this helps ya
-
September 29th, 2004, 09:05 AM
#3
Re: Multiuser application
How about, if you wrote an Active X program, which did all the DB handling for you? This progam could define the connection and recordset withevents. There is an event on recordset called recordchangecomplete and recordsetchangecomplete.
This program could then raise an event. If your program was to define (DIM) this program with events, then you would know that the recordset had changed.
I think for this to work, you would have to use DCOM (I don't know anything about DCOM - so this may be total rubbish), this way all programs would use the same active x program, so when the event fires, it will notify all client programs.
Hopefully this will be of some help, but if I'm way off, appologies.
JP
Please remember to rate all postings.
-
September 29th, 2004, 12:01 PM
#4
Re: Multiuser application
If I were u then I would use a winsock control and on change I would send a mass message to all the users.
-
September 29th, 2004, 01:26 PM
#5
Re: Multiuser application
Thanks everyone for the quick replies.
For the type of application I'm working on, the best solutions seems to be the timer based system that I'm currently using.
However, you people gave me some insight on other possible solutions, so thank you.
Best regards,
Michael Nattfalk
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|