谢谢!!!

解决方案 »

  1.   

    一种笨办法:
    在客户端和服务器端建立一个SOCKET连接。一旦数据发生变化,服务器通过SOCKET发送给客户端一个消息,一旦客户端接收到这个消息,就刷新一次~
      

  2.   

    服务端发生消息给客户端通知期刷新。CSDN还有这方面的贴子,你自己找找看看。
      

  3.   

    我的理解,你是不是想把数据库的信息,返回给客户端。解决方法:
      服务器端编一个SaveData函数,这个函数中要接受客户端ClientDataSet的Delta数据,在执行完更新数据库后,把Delta数据在返回给客户端,在客户端分析Delta数据,以更新客户端的ClientDataSet中的数据。不知道我有没有正确理解你的意思
      

  4.   

    用COM回調--->Server在Client上Raise A Event!!!
      

  5.   

    回调是不是只能用在com连接上呢???如果是用 socket 连接呢???
      

  6.   

    你是指多用户时,在你修改数据还没applyupdates前又有别人修改了同一数据,你现立刻或尽快将这一修改反应到你的客户界面???
    可以用cds的refresh方法,但不推荐,delphi帮助里提到一个cds有一个recordRefresh方法
    可以在cds的afterscroll事件时调用,这样一但有新的变动,就会尽快返应到数据表格中。Client datasets can also update the data while leaving the change log intact. To do this, call the RefreshRecord method. Unlike the Refresh method, RefreshRecord updates only the current record in the client dataset. RefreshRecord changes the record value originally obtained from the provider but leaves any changes in the change log.WarningIt is not always appropriate to call RefreshRecord. If the user's edits conflict with changes made to the underlying dataset by other users, calling RefreshRecord masks this conflict. When the client dataset applies its updates, no reconcile error occurs and the application can't resolve the conflict. In order to avoid masking update errors, you may want to check that there are no pending updates before calling RefreshRecord. For example, the following AfterScroll refreshes the current record every time the user moves to a new record (ensuring the most up-to-date value), but only when it is safe to do so.:procedure TForm1.ClientDataSet1AfterScroll(DataSet: TDataSet);
    begin
      if ClientDataSet1.UpdateStatus = usUnModified then
        ClientDataSet1.RefreshRecord;
    end;