General information
Category:
Coding, syntax & commands
>I have just read the helpfile for SQL2000.
>There is something called "Trigger", Can it be a way, to use a trigger that reacts when someone change the table, and then start a procedure that fetch the changed record from the server, update the local cursor and make the change on the corresponding node? I have not used triggers before but it looks usefull in this case... or am I wrong?
>
>/Kjell
>
>>------------------
>>
>>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.
I don't believe that would work. The trigger could respond to the update of the table, but which users have the form open? You would also not have a handle to each of the forms from the stored procedure in which to update the treeview controls. You could use the trigger to write the communication file with a datetime stamp from which each user could respond to.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only