Menu

PCtoHH syncing

2003-06-30
2003-07-22
  • Eric Cloninger

    Eric Cloninger - 2003-06-30

    Paul,

    Nice work on the conduits, by the way.  I have a few questions, but I'll start with this one.

    Using D6 on XP Pro. I have a Pervasive (aka BTrieve) database that I access through Titan. I set up the data sources and the sync class finds them without a problem. I have three databases that I always want to sync from the PC to the Palm. I'll eventually need to sync a fourth back to the PC, but I'm trying to get this far.

    When I force a sync from PC to handheld, the code wipes the table out on the palm and then calls pfgPalmSyncComponent.SyncSlow(). In SyncSlow, the code goes through the following section:

    pfgPalmSyncComponent.pas

            if (DoGetLocalRecId <> 0) and pfgPalmRemoteTable.locateByID(DoGetLocalRecId) then
            begin
              if compare_and_act(0) <> DeletePalmPC then
              begin
                LocalDataSet.Next;
              end;
            end
            else
            begin
              LocalDataSet.Edit;
              DoSetLocalAttribs(DoGetLocalAttribs and (not eRecAttrDirty));
              pfgPalmRemoteTable.Insert;
              DoCopyToPalm;
              pfgPalmRemoteTable.Post;
              DoSetLocalRecId(pfgPalmRemoteTable.Fields.RecordID);
              LocalDataSet.Post;
              LocalDataSet.Next;
            end;
          end;

    The problem I have is that the code is trying to modify the database as it syncs. The call to LocalDataSet.Post causes Pervasive to return an error code. If I comment out the lines
              LocalDataSet.Edit;
    ...
              DoSetLocalRecId(pfgPalmRemoteTable.Fields.RecordID);
              LocalDataSet.Post;

    It still works. However, I do need to eventually sync one of my databases back to the PC so I doubt this is a good permanent fix.

    Thanks again.

     
    • Paul Gilbert

      Paul Gilbert - 2003-07-22

      I've communicated privately with Eric, but just case anybody is interested, the synchronisation component is modifying the local database becasue it works on the principle that the local database would have a field for storing the per-record status for whether the record has been modified. Once the record has been sent to the Palm, the local record needs to be marked as having been synchronised - hence the editting.

      If anyone has troubles with the synchronisation component, then they can always take out the code they want for the kind of synchronisation they want and have it directly in their own conduit, rather than trying to the use the pre-packaged component

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.