Results 1 to 6 of 6

Thread: Updating Client Data Tables When Data Table on Shared Drive is Updated

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    2

    Updating Client Data Tables When Data Table on Shared Drive is Updated

    Hi,

    I would like to know the best, or standard, way to accomplish real-time client updates in a small multi-user application using an access data table as a data source.

    Specifically, this application will be used by 3-4 people. It uses a datatable which is filled on form load and bound to a datagrid at design time. The datatable is stored on a shared drive. The data table on the shared drive is updated in two ways:

    1) Users can update the datagrid which then updates the datatable on the shared drive via the data adapter's Update method.

    2) A server application does some work on some text files, periodically updating the data table.


    I need the clients to reflect the changes to the data table on the shared drive as closely to real-time as possible. I know that the data table stored in memory on the client is disconnected from the data table on the shared drive, so I must query again to get the updates.

    I have two questions:

    1) Is there an alternvative model I can use which is connected, and which will automatically reflect the updates in the data table on the shared drive?

    2) If not, what is the best way to check for changes in the data table (so I can know when to call the data adapter fill method)? I am planning to poll the drive for a change to the .mdb file, raise an event and then fill the data adapter when the event is triggered. I am using this method successfully now to check for changes to a text file in another application, and I know how to implement it, but I am wondering if there is a better way.


    Thanks

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Updating Client Data Tables When Data Table on Shared Drive is Updated

    It's not easy... You can try this:
    1. Having app1 listening to UPD message from some port. And when it receives a message, it re-query the database for updated data.
    2. In both app1 and server app, when they update the database, broadcast an UDP message signaling that the database has just been updated.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Updating Client Data Tables When Data Table on Shared Drive is Updated

    MS is putting something together that might apply very directly to what you are doing. I have heard about it, but never used it. Here's some info:


    Introduction

    Microsoft Sync Framework is a comprehensive synchronization platform that enables collaboration and offline access for applications, services and devices. It features technologies and tools that enable roaming, sharing, and taking data offline. Using Microsoft Sync Framework, developers can build sync ecosystems that integrate any application, with any data from any store using any protocol over any network.
    A key aspect of the Microsoft Sync Framework is the ability to create custom synchronization providers. A provider is a software component that represents a replica for synchronization. A replica is a particular repository of information to be synchronized, such as a file system on a handheld device. When representing a data source, a provider enumerates changes from its replica. When representing a destination, a provider applies changes to its replica. If the data at the source and destination differ in type or schema, each provider performs any necessary mapping or transformation.

    … more …

    http://msdn.microsoft.com/en-us/sync/bb821992.aspx
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    2

    Re: Updating Client Data Tables When Data Table on Shared Drive is Updated

    Thanks for the replies. Any thoughts on using a FileSystemWatcher (the updates are fairly infrequent, once every 5 to 15 minutes), rather than sending UDP messages?

    Thanks.

  5. #5
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Updating Client Data Tables When Data Table on Shared Drive is Updated

    No, you cannot use the FileSystemWatcher component to monitor the changes in an Access database. The reason for this is that everytime you run a query against the database, the mdb file's LastWriteTime is changed thus the FSW trigger an event. If you're toto re-query the DB when this event is raised, you'll end up being in a circular endless loop.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  6. #6
    Hyperactive Member Always_Confused's Avatar
    Join Date
    Jun 2006
    Location
    Alabama USA
    Posts
    417

    Re: Updating Client Data Tables When Data Table on Shared Drive is Updated

    I agree with Stanav. There really is not a good method to do this. Stay away from file datetime stamps! Comparing between FAT and NTFS drives will mess with you comparing the time difference.

    Question, why are you wanting to maintain 2 separate DB's? Are they mobile sometimes off the network, afraid you might lose the data on the server, or a performance issue? If it is redundancy you are wanting then have 2 DB's each on a different drive and have a Slave and a Master synch.

    As far as the text files, what format are you storing them in?
    If you find information helpful from any member, please take a second and rate their post. Its a nice gesture of your appreciation.

    "I have not failed 10,000 times. I have successfully identified 10,000 ways that will not work" Thomas Edison

    Do illiterate people get the full effect of Alphabet Soup?

    ADO FAQ 2005-2008 Masked Textbox Patch FoxPro Date MZ Tools Great Free Tool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width