Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update a Treeview in a multiuser environment
Message
De
07/12/2005 18:31:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/12/2005 18:29:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
01075888
Message ID:
01075938
Vues:
43
>>>Hallo!
>>>I did a treeview (MS Treeview 6.0) where the users can add nodes, remove nodes, change the node text... and so
>>>on. Its fairly like Windows Explorer. Everything is saved i a table on an SQL server 2000.
>>>It works very good if there only is ONE user, but if one user is manipulating the treeview, and in the same time
>>>an other user is doing the same thing, there will be some kind of conflict. The last user who is closing the >>tree and save the data on the server is writing over the changes that the other users has done.
>>>Is there a common way to do, so all users allways has the same structure on the tree regardless who is changing
>>>the treeview.
>>>In Internet Explorer you can see immediately on a network disc if any change is made, whithout doin anything
>>>yourself.
>>>I dont know how to tackle this problem. One possibility is to make the tree readonly to everyone except the first user (like a worddocument on a network disc). But what happens if the user is going home whitout closing the tree. It is not a good solution. There must be some finished solution somewhere, because I dont think I am the first with this problem.
>>>Does anyone has any hints or links to some document where I can read about this.
>>>I am greatful for any answer that make me to go further.
>>>It would be a pity if I cant use this wellworking treeview in a multiuser enviroment.
>>>
>>>Thanks in advance
>>>/Kjell
>
>>Kjell,
>>Treeview has no direct binding to data so I really didn't understand how it poses a problem in a multiuser environment. You can add/remove nodes as you see fit. Check UT magazine June 2001 issue.
>
>------------------
>
>The treeview does not support natively a multiuser environment -- it is designed for a single user on a single pc; it has no knowledge of someone else changing the node structure on another PC. To enable this, you might try using bindevent (or a timer but it would be delayed) and a communication file. The scenario might go something like this:
>
>1. User one opens the form on local PC with treeview; nodes built
> from shared table; bindevent set
>2. User two opens the form on local PC with treeview; nodes built
> from shared table; bindevent set
>3. User one adds/deletes/changes node; update shared table and update
> communication file on server with timestamp of change.
>4. User two bindevent detects change of communication file; re-reads
> shared table for changes (based on timestamp) and updates local
> view of treeview.
>
>This is repeated by each user. The bindevent would be to a Win32 API that monitors files.

Thank you Greg. Tough I don't have such a problem I'll keep this in mind.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform