Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Replication / January 2008

Tip: Looking for answers? Try searching our database.

Completely stuck with Indirect Replication - Please help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
martyn@neptunect.co.uk - 15 Jan 2008 16:59 GMT
Hi,

I'm completely stuck and could really do with some straight forward
instructions on setting up Replication with Indirect Synchronization.
Here's the situation...

- I'm using Access 2003.

- I have two PC's connected over a LAN (I need Indirect Sync as one
will be connecting via a VPN soon).

- I have created a database on PC1 and used the TSI synchronizer
sample code to make a replica directly on the Hard drive of PC2.

- I do not have access to the Replication Manager software.

- Each PC has a dropbox at c:\dropbox, shared as 'dropbox' with (as
far as I can tell) all the correct read/write permissions.  I can see
each dropbox from the other PC using Explorer.

- Each PC runs the MSTran40.exe and regedit shows FSAddress pointing
to the other PC's dropbox.

- I use the following code in each DB to perform the sync.

   Dim sync As Synchronizer
   Dim reps As Replicas
   Dim rep As Replica
   Set sync = New Synchronizer
   'Set reps = sync.ReplicaSet

   sync.Running = True
   sync.IndirectDropbox = "\\PC2\dropbox"
   sync.DatabaseName = "C:\reptest\MasterDB.mdb"

   Set reps = sync.ReplicaSet
   For Each rep In reps
       If rep.ReplicaID <> sync.ReplicaID Then
           sync.SynchIndirect rep.SynchronizerID
       End If
   Next rep

   sync.Running = False
   Set sync = Nothing

- When I first run it on each PC, it writes the WingMan.sgn file in
the other PCs dropbox.

My problem is that it never ever writes any msg files, even though the
sync completes without errors and I have added/changed data on the
tables!!!

Please help - What am I missing here?  I've tried my best reading
articles on the net (including those by D. Fenton), but am well and
truly stuck!

Thanks.

Martyn.
Tim - 20 Jan 2008 05:35 GMT
> - Each PC runs the MSTran40.exe and regedit shows FSAddress pointing
> to the other PC's dropbox.
You may have a config error.  When you run the synchronizer, it places
a wingman.sgn file in the dropbox folder that it is assigned to use;
this folder is typically on the local computer.  If a sychronizer is
placing files in a folder on a remote computer, that indicates that
you've configured it so that the remote computer has your dropbox.
Typical configuration is that the dropbox resides on the local
computer.   Thus, if my machine name is MYComputer and the folder is
shared at C:\Dropbox, the FS Address should be \\MyComputer\Dropbox.

> - I use the following code in each DB to perform the sync.
>
[quoted text clipped - 17 lines]
>     sync.Running = False
>     Set sync = Nothing

A few items:
First, there is nothing in the above code that tells the synchronizer
to shut down ONLY when it's done with all the synchronizations you've
asked it to do.  I run a star topology:  I have a replica farm at the
center of the star, and multiple laptops out in the field.  When a
field user decides they want to replicate, they do so only with the
center of the star.  Here is the code I use:

   Dim lngSyncStatus As Long
   Dim HistItem As Synch40.HistoryItem

   strExchange = sync.SynchIndirect("{F6...........9}",
synchTypeReplImpExp)
   Do Until lngSyncStatus > 1
           Set HistItem = sync.HistoryItemOfExchangeId(strExchange)
           lngSyncStatus = HistItem.SynchStatus
           If lngOldStatus <> lngSyncStatus Then
               Select Case lngSyncStatus
                   Case 0
                       'you'll be here while synchronization is
requested
                   Case 1
                       'you'll be here while sychronization is in
process
               End Select
           End If
           DoEvents
   Loop

   Select Case lngSyncStatus
       Case 2
           'you'll be here if you have a successful sychronization
       Case 3
           'you'll be here if your synchronization failed
       Case 4
           'you'll be here if your sychronization was cancelled
   End Select

Essentially what I do is set the synchronization up and running, and
then let it run until the lngSyncStatus variable goes above 1.  When
it does, I know that something has happened.  Then, and only then, do
I close the synchronizer and set it equal to nothing.

Also, because I'm running a star topology, I always know the
synchronizerID of the synchronizer that runs on the hub; for that
reason, I just feed that string variable in the rep.synchronizerID
statement.

> - When I first run it on each PC, it writes the WingMan.sgn file in
> the other PCs dropbox.

See first comment; you shouldn't be writing to another computer's
folder/dropbox.
David W. Fenton - 20 Jan 2008 22:33 GMT
Tim <timothy_e_white@hotmail.com> wrote in
news:1dda5e8b-0abe-4a61-9412-a0b51980c7ad@z17g2000hsg.googlegroups.co
m:

> You may have a config error.  When you run the synchronizer, it
> places a wingman.sgn file in the dropbox folder that it is
[quoted text clipped - 5 lines]
> name is MYComputer and the folder is shared at C:\Dropbox, the FS
> Address should be \\MyComputer\Dropbox.

The wingman.sgn file is indeed created by the synchronizer in the
local dropbox.

But the local synchronizer does write to the remote dropbox.

When you initiated an indirect synch, the local synchronizer writes
a MSG file to the remote dropbox. That remote machine's synchronizer
notices that MSG file, reads it, and then writes a MSG file from the
remote machine to the local dropbox. The local synchronizer reads
that MSG file and then knows what it needs to write to the remote
dropbox, which is usually at that point an MDB file.

This process can go back and forth several times before the synch is
complete.

So, the main issue is that the local machine needs to be able to
write to the remote dropbox. If permissions are not correct (either
on the remote share or on the folder underlying that share), then
the synchronizer won't be able to write to it. You can test this by
viewing the remote dropbox in Windows Explore, and right clicking
and choosing NEW -> Text Document. If you can create the text file,
you've got full write permission to the remote dropbox.

Remember that both synchronizers need to be running and that it's
easiest to not have the replicas you are synching in shared folders,
because under certain circumstances (not all of them), the
synchronizer will ignore your command to do an indirect synch and do
direct instead. The exchange history table will tell you which kind
of synch it was.

Signature

David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.